[Collab-maint-devel] collab-maint SVN: r106 - in lib/trunk: . bin
etc lib/collabmaint
hertzog at debian.org
hertzog at debian.org
Sat Jan 28 21:50:48 UTC 2006
Author: hertzog
Date: 2006-01-28 21:50:47 +0000 (Sat, 28 Jan 2006)
New Revision: 106
Added:
lib/trunk/bin/create-db.py
lib/trunk/lib/collabmaint/db.py
Modified:
lib/trunk/README
lib/trunk/bin/list-packages.py
lib/trunk/etc/collab-maint.conf
lib/trunk/lib/collabmaint/conf.py
Log:
- First try with SQLObject, added a collabmaint.db module.
- Changed collabmaint.conf module, a default instance is always created, the
scripts can use this object directly.
- Added new parameters in the configuration file.
Modified: lib/trunk/README
===================================================================
--- lib/trunk/README 2006-01-26 15:53:24 UTC (rev 105)
+++ lib/trunk/README 2006-01-28 21:50:47 UTC (rev 106)
@@ -2,6 +2,7 @@
Packages required :
-------------------
pythonX.X-subversion
+pythonX.X-sqlobject
pythonX.X-apt
Executing scripts :
@@ -12,7 +13,7 @@
If you want to execute them from somewhere else, you should export
PYTHONHOME=`pwd`/lib before. Beware that the configuration file is looked
-into "./lib/collab-maint.conf" then "/etc/collab-maint.conf". If you want
+into "./etc/collab-maint.conf" then "/etc/collab-maint.conf". If you want
to indicate another path for the configuration file, just use a "-c
<config_file_path>" parameter.
Added: lib/trunk/bin/create-db.py
===================================================================
--- lib/trunk/bin/create-db.py 2006-01-26 15:53:24 UTC (rev 105)
+++ lib/trunk/bin/create-db.py 2006-01-28 21:50:47 UTC (rev 106)
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+
+"""Execute this script to create the required tables in the database"""
+
+import sys
+sys.path.append("./lib")
+
+from collabmaint.db import *
+
+Package.createTable(ifNotExists=True)
+Version.createTable(ifNotExists=True)
+Suite.createTable(ifNotExists=True)
+Contributor.createTable(ifNotExists=True)
+Comment.createTable(ifNotExists=True)
+
Property changes on: lib/trunk/bin/create-db.py
___________________________________________________________________
Name: svn:executable
+ *
Modified: lib/trunk/bin/list-packages.py
===================================================================
--- lib/trunk/bin/list-packages.py 2006-01-26 15:53:24 UTC (rev 105)
+++ lib/trunk/bin/list-packages.py 2006-01-28 21:50:47 UTC (rev 106)
@@ -3,11 +3,9 @@
import sys
sys.path.append("./lib")
-from collabmaint.conf import *
+from collabmaint.conf import Cnf
from collabmaint.repos.builder import RepositoryBuilder
-Cnf = CMConf();
-
builder = RepositoryBuilder()
objects = []
for name in Cnf["ActiveRepositories"].split(" "):
Modified: lib/trunk/etc/collab-maint.conf
===================================================================
--- lib/trunk/etc/collab-maint.conf 2006-01-26 15:53:24 UTC (rev 105)
+++ lib/trunk/etc/collab-maint.conf 2006-01-28 21:50:47 UTC (rev 106)
@@ -1,20 +1,26 @@
+DB "sqlite:/tmp/collab-maint.db";
+
+Directory "/tmp/collab-maint";
+
ActiveRepositories "LocalSVN CollabMaintSVN";
ActiveDistributions "Debian Ubuntu";
Distributions::Debian {
- Unstable {
+ Suites "unstable experimental";
+ unstable {
distribution "unstable";
debsrc "http://ftp.fr.debian.org/debian unstable main contrib non-free";
};
- Experimental {
+ experimental {
distribution "experimental";
debsrc "http://ftp.fr.debian.org/debian experimental main contrib non-free";
};
};
Distributions::Ubuntu {
- Dapper {
+ Suites "dapper";
+ dapper {
distribution "dapper";
debsrc "";
};
Modified: lib/trunk/lib/collabmaint/conf.py
===================================================================
--- lib/trunk/lib/collabmaint/conf.py 2006-01-26 15:53:24 UTC (rev 105)
+++ lib/trunk/lib/collabmaint/conf.py 2006-01-28 21:50:47 UTC (rev 106)
@@ -29,3 +29,6 @@
def __getitem__(self, key):
return self.Cnf[key]
+# Default instance
+Cnf = CMConf()
+
Added: lib/trunk/lib/collabmaint/db.py
===================================================================
--- lib/trunk/lib/collabmaint/db.py 2006-01-26 15:53:24 UTC (rev 105)
+++ lib/trunk/lib/collabmaint/db.py 2006-01-28 21:50:47 UTC (rev 106)
@@ -0,0 +1,32 @@
+
+from collabmaint.conf import Cnf
+from sqlobject import *
+
+__connection__ = Cnf["DB"]
+
+class Package(SQLObject):
+ name = StringCol()
+ versions = MultipleJoin('Version')
+
+class Suite(SQLObject):
+ distribution = StringCol(alternateID=True)
+
+class Version(SQLObject):
+ package = ForeignKey('Package')
+ version = StringCol()
+ source = StringCol()
+ suite = ForeignKey('Suite')
+
+class Contributor(SQLObject):
+ name = StringCol()
+ email = StringCol()
+ login = StringCol()
+
+class Comment(SQLObject):
+ package = ForeignKey('Package')
+ content = StringCol()
+ author = ForeignKey('Contributor')
+ needFix = BoolCol()
+ fixedBy = ForeignKey('Contributor')
+ fixedOn = DateTimeCol()
+
More information about the Collab-maint-devel
mailing list