[Checkins] SVN: Sandbox/adamg/zope.wineggbuilder/trunk/ checkpoint

Adam Groszer agroszer at gmail.com
Mon Jun 7 14:08:24 EDT 2010


Log message for revision 113247:
  checkpoint

Changed:
  U   Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/base.py
  U   Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/build.py
  U   Sandbox/adamg/zope.wineggbuilder/trunk/test.ini

-=-
Modified: Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/base.py
===================================================================
--- Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/base.py	2010-06-07 16:34:04 UTC (rev 113246)
+++ Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/base.py	2010-06-07 18:08:23 UTC (rev 113247)
@@ -21,6 +21,8 @@
 
 is_win32 = sys.platform == 'win32'
 
+BUILD_SECTION = 'build'
+
 class Command(object):
     def __init__(self, cwd=None, captureOutput=True, exitOnError=True):
         self.cwd = cwd

Modified: Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/build.py
===================================================================
--- Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/build.py	2010-06-07 16:34:04 UTC (rev 113246)
+++ Sandbox/adamg/zope.wineggbuilder/trunk/src/zope/wineggbuilder/build.py	2010-06-07 18:08:23 UTC (rev 113247)
@@ -19,17 +19,62 @@
 
 LOGGER = base.LOGGER
 
+def getOption(config, section, name, default=None):
+    try:
+        return config.get(section, name)
+    except ConfigParser.NoOptionError:
+        self.uploadType = 'internal'
+
+
 class Compiler(object):
-    pass
+    def __init__(self, name, config, options):
+        self.name = name
+        self.options = options
+        self.read(config)
 
+    def read(self, config):
+        self.command = config.get(self.name, 'command')
+        self.fileEnding = config.get(self.name, 'fileEnding')
+
 class Package(object):
-    pass
+    def __init__(self, name, config, options, compilers):
+        self.name = name
+        self.options = options
+        self.read(config, compilers)
 
+    def read(self, config):
+        self.pypiurl = config.get(self.name, 'pypiurl')
+        self.tagurl = config.get(self.name, 'tagurl')
+        self.minVersion = getOption(config, self.name, 'minVersion')
+        self.maxVersion = getOption(config, self.name, 'maxVersion')
+        self.targets = []
+        for target in config.get(self.name, 'targets').split():
+            self.targets.append(compilers[target])
+
+    def build(self):
+        pass
+        #1 get versions from pypi
+        #2 get file list of the version
+        #3 check file endings
+        #4 build missing
+
 class Builder(object):
     def __init__(self, configFileName, options):
-        pass
+        config = ConfigParser.RawConfigParser()
+        config.read(configFileName)
 
+        self.compilers = {}
+        for cmp in config.get(base.BUILD_SECTION, 'compilers').split():
+            self.compilers[cmp] = Compiler(cmp, config, options)
 
+        self.packages = []
+        for pkg in config.get(base.BUILD_SECTION, 'packages').split():
+            self.packages.append(Package(pkg, config, options, self.compilers))
+
+        for pkg in self.packages:
+            pkg.build()
+
+
 def main(args=None):
     # Make sure we get the arguments.
     if args is None:
@@ -70,4 +115,3 @@
 
     # Exit cleanly.
     sys.exit(0)
-

Modified: Sandbox/adamg/zope.wineggbuilder/trunk/test.ini
===================================================================
--- Sandbox/adamg/zope.wineggbuilder/trunk/test.ini	2010-06-07 16:34:04 UTC (rev 113246)
+++ Sandbox/adamg/zope.wineggbuilder/trunk/test.ini	2010-06-07 18:08:23 UTC (rev 113247)
@@ -1,5 +1,5 @@
-interpreters = py24_32 py25_32 py26_32 py26_64
-
+[build]
+compilers = py24_32 py25_32 py26_32 py26_64
 packages = zope.proxy
 
 [py24_32]



More information about the checkins mailing list