diff carton.py @ 36:77285bafc36a

better formatting
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 09 Apr 2012 13:17:38 -0700
parents 122c56779f2b
children 33e5d444ff30
line wrap: on
line diff
--- a/carton.py	Mon Aug 08 18:08:49 2011 -0700
+++ b/carton.py	Mon Apr 09 13:17:38 2012 -0700
@@ -97,7 +97,7 @@
         break
 else:
     raise Exception("virtualenv.py not found in " + tempdir)
-        
+
 # create the virtualenv
 os.environ.pop('PYTHONHOME', None)
 call([sys.executable, virtualenv, ENV])
@@ -181,6 +181,13 @@
 def main(args=sys.argv[1:]):
 
     # parse CLI arguments
+    class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
+        """description formatter for console script entry point"""
+        def format_description(self, description):
+            if description:
+                return description.strip() + '\n'
+            else:
+                return ''
     parser = OptionParser(usage=usage, description=__doc__)
     parser.add_option('-o', dest='outfile',
                       help="specify outfile; otherwise it will come from environment_name")
@@ -230,7 +237,7 @@
                     return os.path.getmtime(os.path.join(dist_dir, filename))
                 tarfiles.sort(key=last_modified)
                 source = os.path.join(dist_dir, tarfiles[-1])
-            
+
             if (not os.path.isdir(source)) and tarfile.is_tarfile(source):
                 # check for a tarball
                 buffer = file(source).read()
@@ -243,7 +250,6 @@
                 buffer = source_buffer.getvalue()
 
         # could use git, hg, etc repos. but probably shouldn't
-        
         source_array.append(buffer.encode('zlib').encode('base64'))
 
     # tar up virtualenv if not available