# HG changeset patch # User Jeff Hammel # Date 1334002658 25200 # Node ID 77285bafc36ac6aba7d1f3616f291662c19c2db3 # Parent 122c56779f2b95548775000417e43fad9f5c41cc better formatting diff -r 122c56779f2b -r 77285bafc36a carton.py --- 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