[Checkins] SVN: Sandbox/philikon/zopeproject/trunk/ If the user already has a default eggs directory set in

Philipp von Weitershausen philikon at philikon.de
Mon Jul 16 17:50:16 EDT 2007


Log message for revision 78041:
  If the user already has a default eggs directory set in
  ~/.buildout/default.cfg, it is used as the default value for the
  eggs directory.
  

Changed:
  U   Sandbox/philikon/zopeproject/trunk/README.txt
  U   Sandbox/philikon/zopeproject/trunk/TODO.txt
  U   Sandbox/philikon/zopeproject/trunk/zopeproject/templates.py

-=-
Modified: Sandbox/philikon/zopeproject/trunk/README.txt
===================================================================
--- Sandbox/philikon/zopeproject/trunk/README.txt	2007-07-16 19:20:16 UTC (rev 78040)
+++ Sandbox/philikon/zopeproject/trunk/README.txt	2007-07-16 21:50:15 UTC (rev 78041)
@@ -33,7 +33,9 @@
 0.3.2 (unreleased)
 ------------------
 
-* ...
+* If the user already has a default eggs directory set in
+  ~/.buildout/default.cfg, it is used as the default value for the
+  eggs directory.
 
 0.3.1 (2007-07-15)
 ------------------

Modified: Sandbox/philikon/zopeproject/trunk/TODO.txt
===================================================================
--- Sandbox/philikon/zopeproject/trunk/TODO.txt	2007-07-16 19:20:16 UTC (rev 78040)
+++ Sandbox/philikon/zopeproject/trunk/TODO.txt	2007-07-16 21:50:15 UTC (rev 78041)
@@ -10,6 +10,13 @@
 * README: explain how to add more dependencies to your new
   application.
 
+* README: document different command line options, e.g. --newest for
+  checking for newer eggs.
+
 * Maybe rename application.py to app_factory.py or something like
   that? (application.py sort of collides with grok's app.py)
 
+* Discover existing egg cache settings and use those as defaults:
+  https://bugs.launchpad.net/grok/+bug/125817
+
+* Need tests!

Modified: Sandbox/philikon/zopeproject/trunk/zopeproject/templates.py
===================================================================
--- Sandbox/philikon/zopeproject/trunk/zopeproject/templates.py	2007-07-16 19:20:16 UTC (rev 78040)
+++ Sandbox/philikon/zopeproject/trunk/zopeproject/templates.py	2007-07-16 21:50:15 UTC (rev 78041)
@@ -1,9 +1,19 @@
 import sys
 import os.path
 import shutil
+from ConfigParser import ConfigParser
 from paste.script.templates import var, NoDefault, Template, BasicPackage
 
-HOME = os.path.expanduser('~')
+def determine_eggs_dir():
+    HOME = os.path.expanduser('~')
+    default_cfg = os.path.join(HOME, '.buildout', 'default.cfg')
+    if os.path.isfile(default_cfg):
+        cfg = ConfigParser()
+        cfg.read(default_cfg)
+        eggs_dir = cfg.get('buildout', 'eggs-directory')
+        if eggs_dir:
+            return eggs_dir
+    return os.path.join(HOME, 'buildout-eggs')
 
 class ZopeDeploy(Template):
     _template_dir = 'zope_deploy'
@@ -14,7 +24,7 @@
         var('passwd', 'Password for the initial administrator user',
             default=NoDefault),
         var('eggs_dir', 'Location where zc.buildout will look for and place '
-            'packages', default=os.path.join(HOME, 'buildout-eggs'))
+            'packages', default=determine_eggs_dir())
         ]
 
     def check_vars(self, vars, cmd):



More information about the Checkins mailing list