[Checkins] SVN: z3c.versionedresource/trunk/ * Feature: Do not fail, if a directory already exists.

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Aug 10 03:30:40 EDT 2008


Log message for revision 89589:
  * Feature: Do not fail, if a directory already exists.
  
  * Feature: Print an error before exiting with exit code 1.
  
  * Feature: Files in a directory ending in *.html are now converted to regular
    file resources and not as page template resources.
  

Changed:
  _U  z3c.versionedresource/trunk/
  U   z3c.versionedresource/trunk/CHANGES.txt
  U   z3c.versionedresource/trunk/setup.py
  U   z3c.versionedresource/trunk/src/z3c/versionedresource/list.py
  U   z3c.versionedresource/trunk/src/z3c/versionedresource/resource.py

-=-

Property changes on: z3c.versionedresource/trunk
___________________________________________________________________
Name: svn:ignore
   - .installed.cfg
bin
develop-eggs
dist
parts

   + .installed.cfg
bin
coverage
develop-eggs
dist
parts


Modified: z3c.versionedresource/trunk/CHANGES.txt
===================================================================
--- z3c.versionedresource/trunk/CHANGES.txt	2008-08-10 06:11:15 UTC (rev 89588)
+++ z3c.versionedresource/trunk/CHANGES.txt	2008-08-10 07:30:39 UTC (rev 89589)
@@ -2,6 +2,16 @@
 CHANGES
 =======
 
+Version 0.3.0 (2008-08-09)
+--------------------------
+
+* Feature: Do not fail, if a directory already exists.
+
+* Feature: Print an error before exiting with exit code 1.
+
+* Feature: Files in a directory ending in *.html are now converted to regular
+  file resources and not as page template resources.
+
 Version 0.2.0 (2008-08-09)
 --------------------------
 

Modified: z3c.versionedresource/trunk/setup.py
===================================================================
--- z3c.versionedresource/trunk/setup.py	2008-08-10 06:11:15 UTC (rev 89588)
+++ z3c.versionedresource/trunk/setup.py	2008-08-10 07:30:39 UTC (rev 89589)
@@ -23,7 +23,7 @@
 
 setup (
     name='z3c.versionedresource',
-    version='0.3.0dev',
+    version='0.3.0',
     author = "Stephan Richter and the Zope Community",
     author_email = "zope3-dev at zope.org",
     description = "Versioned Resources",

Modified: z3c.versionedresource/trunk/src/z3c/versionedresource/list.py
===================================================================
--- z3c.versionedresource/trunk/src/z3c/versionedresource/list.py	2008-08-10 06:11:15 UTC (rev 89588)
+++ z3c.versionedresource/trunk/src/z3c/versionedresource/list.py	2008-08-10 07:30:39 UTC (rev 89589)
@@ -70,7 +70,8 @@
     # For directory resources, we create the directory and walk through the
     # children.
     if isinstance(resource, DirectoryResource):
-        os.mkdir(outputPath)
+        if not os.path.exists(outputPath):
+            os.mkdir(outputPath)
         for name in [name for name in os.listdir(resource.context.path)
                      if name not in EXCLUDED_NAMES]:
             subResource = resource.get(name, None)
@@ -101,7 +102,8 @@
     # Now we can produce the version directory with all resources in it
     version = zope.component.getUtility(interfaces.IVersionManager).version
     outputdir = os.path.join(options.dir, version)
-    os.mkdir(outputdir)
+    if not os.path.exists(outputdir):
+        os.mkdir(outputdir)
     for name, resource in resources:
         storeResource(outputdir, name, resource, options.zip)
     print outputdir
@@ -164,6 +166,7 @@
     options = get_options(args)
     try:
         produceResources(options)
-    except Exception:
+    except Exception, err:
+        print err
         sys.exit(1)
     sys.exit(0)

Modified: z3c.versionedresource/trunk/src/z3c/versionedresource/resource.py
===================================================================
--- z3c.versionedresource/trunk/src/z3c/versionedresource/resource.py	2008-08-10 06:11:15 UTC (rev 89588)
+++ z3c.versionedresource/trunk/src/z3c/versionedresource/resource.py	2008-08-10 07:30:39 UTC (rev 89589)
@@ -75,7 +75,6 @@
         '.jpg':  ImageResourceFactory,
         '.pt':   pagetemplateresource.PageTemplateResourceFactory,
         '.zpt':  pagetemplateresource.PageTemplateResourceFactory,
-        '.html': pagetemplateresource.PageTemplateResourceFactory,
         }
 
     default_factory = FileResourceFactory



More information about the Checkins mailing list