summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Hopkins <marduk@gentoo.org>2005-10-04 04:09:45 +0000
committerAlbert Hopkins <marduk@gentoo.org>2005-10-04 04:09:45 +0000
commit117b9d4ad2e10e948dccdf01e450ed75bfeb2712 (patch)
tree4e6a94ead3bae0fd916c32f944359474cf35823d
parentMore additions/removals for pre-2.0 (diff)
downloadgentoo-117b9d4ad2e10e948dccdf01e450ed75bfeb2712.tar.gz
gentoo-117b9d4ad2e10e948dccdf01e450ed75bfeb2712.tar.bz2
gentoo-117b9d4ad2e10e948dccdf01e450ed75bfeb2712.zip
* Oops, I forgot that .ptl files can't have doc strings. fixed
* Added .sql files to create tables
-rw-r--r--src/packages/sql/create_category.sql5
-rw-r--r--src/packages/sql/create_deps.sql9
-rw-r--r--src/packages/sql/create_ebuild.sql12
-rw-r--r--src/packages/sql/create_packages.sql8
-rw-r--r--src/packages/sql/create_tip.sql5
-rw-r--r--src/packages/ui/main.ptl36
6 files changed, 54 insertions, 21 deletions
diff --git a/src/packages/sql/create_category.sql b/src/packages/sql/create_category.sql
new file mode 100644
index 0000000000..b60f9116d6
--- /dev/null
+++ b/src/packages/sql/create_category.sql
@@ -0,0 +1,5 @@
+CREATE TABLE `category` (
+ `name` varchar(40) NOT NULL default '',
+ `description` text,
+ PRIMARY KEY (`name`)
+)
diff --git a/src/packages/sql/create_deps.sql b/src/packages/sql/create_deps.sql
new file mode 100644
index 0000000000..63e0d180aa
--- /dev/null
+++ b/src/packages/sql/create_deps.sql
@@ -0,0 +1,9 @@
+CREATE TABLE `deps` (
+ `category` varchar(30) NOT NULL default '',
+ `name` varchar(45) NOT NULL default '',
+ `version` varchar(30) NOT NULL default '',
+ `depend` mediumtext,
+ `rdepend` mediumtext,
+ `pdepend` mediumtext,
+ PRIMARY KEY (`category`,`name`,`version`)
+)
diff --git a/src/packages/sql/create_ebuild.sql b/src/packages/sql/create_ebuild.sql
new file mode 100644
index 0000000000..d14594759a
--- /dev/null
+++ b/src/packages/sql/create_ebuild.sql
@@ -0,0 +1,12 @@
+CREATE TABLE `ebuild` (
+ `category` varchar(30) NOT NULL default '',
+ `name` varchar(45) NOT NULL default '',
+ `version` varchar(30) NOT NULL default '',
+ `when_found` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `arch` varchar(160) NOT NULL default '',
+ `changelog` mediumtext,
+ `prevarch` varchar(160) NOT NULL default '',
+ `is_masked` tinyint(4) default NULL,
+ `license` varchar(30) default NULL,
+ PRIMARY KEY (`category`,`name`,`version`)
+)
diff --git a/src/packages/sql/create_packages.sql b/src/packages/sql/create_packages.sql
new file mode 100644
index 0000000000..c57744e33c
--- /dev/null
+++ b/src/packages/sql/create_packages.sql
@@ -0,0 +1,8 @@
+CREATE TABLE `package` (
+ `category` varchar(30) NOT NULL default '',
+ `name` varchar(40) NOT NULL default '',
+ `homepage` varchar(100) default NULL,
+ `description` text,
+ `when_found` datetime NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (`category`,`name`)
+)
diff --git a/src/packages/sql/create_tip.sql b/src/packages/sql/create_tip.sql
new file mode 100644
index 0000000000..7b010c5468
--- /dev/null
+++ b/src/packages/sql/create_tip.sql
@@ -0,0 +1,5 @@
+CREATE TABLE `tip` (
+ `id` int(11) NOT NULL auto_increment,
+ `tip` text,
+ PRIMARY KEY (`id`)
+)
diff --git a/src/packages/ui/main.ptl b/src/packages/ui/main.ptl
index 351936cd5d..4126c385da 100644
--- a/src/packages/ui/main.ptl
+++ b/src/packages/ui/main.ptl
@@ -1,13 +1,9 @@
-"""
-This is the code necessary for rendering all (most?) of the pages for
-`packages.gentoo.org`_. Since the format of the pages pretty much look the
-same, we can just call these functions to render the page. The only real
-functions outside modules need to worry about is 'page()' and 'sidebody()'
-
-See also: menu.do_menu()
-
-"""
-__docformat__ = 'reStructuredText'
+## This is the code necessary for rendering all (most?) of the pages for
+## packages.gentoo.org. Since the format of the pages pretty much look the
+## same, we can just call these functions to render the page. The only real
+## functions outside modules need to worry about is 'page()' and 'sidebody()'
+##
+## See also: menu.do_menu()
from time import gmtime
from menu import do_menu, SUPER
@@ -41,18 +37,16 @@ def top [html] ():
"</div> <!-- header -->"
def do_body [html] (body, noparent = False):
- """
- Render the body.
-
- body can be a string or a 3-tuple:
- * if 'body' is a string then this is a one-column body and it is rendered
- * if 'body' is a 3-tuple, then is is regarded as (left, middle, right)
- columns. 'left' and/or 'right' can be empty or None in which case they
- will not be rendered. 'middle' is mandatory.
+ ## Render the body.
+ ##
+ ## body can be a string or a 3-tuple:
+ ## * if 'body' is a string then this is a one-column body and it is rendered
+ ## * if 'body' is a 3-tuple, then is is regarded as (left, middle, right)
+ ## columns. 'left' and/or 'right' can be empty or None in which case they
+ ## will not be rendered. 'middle' is mandatory.
+ ##
+ ## (None, middle, None) is the same as just passing middle as a string
- (None, middle, None) is the same as just passing middle as a string
-
- """
if type(body) is list:
if len(body) == 3:
left, middle, right = body