[Checkins] SVN: z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/__init__.py * Support several paths in a row

Uli Fouquet uli at gnufix.de
Tue Aug 18 20:23:47 EDT 2009


Log message for revision 102931:
  * Support several paths in a row
  
  * Normalize paths before creation.
  
  * Make paths absolute before creation.
  

Changed:
  U   z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/__init__.py

-=-
Modified: z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/__init__.py
===================================================================
--- z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/__init__.py	2009-08-18 23:17:37 UTC (rev 102930)
+++ z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/__init__.py	2009-08-19 00:23:46 UTC (rev 102931)
@@ -11,17 +11,21 @@
         self.options=options
         self.logger=logging.getLogger(self.name)
 
-        self.path = None
+        path = None
         if "path" in options:
-            self.path = options["path"]
+            path = options["path"]
         else:
-            self.path = os.path.join(
+            path = os.path.join(
                 buildout['buildout']['parts-directory'], name)
-        self.path = os.path.abspath(self.path)
+        path = [x.strip() for x in path.split('\n')]
+        path = [os.path.abspath(x) for x in path]
+        path = [os.path.normpath(x) for x in path]
+        self.path = path
 
     def install(self):
-        self.createIntermediatePaths(self.path)
-        self.options.created(self.path)
+        for path in self.path:
+            self.createIntermediatePaths(path)
+            self.options.created(path)
         return self.options.created()
 
 



More information about the Checkins mailing list