Mercurial > hg > carton
comparison carton.py @ 37:33e5d444ff30
fix
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Mon, 09 Apr 2012 13:20:05 -0700 |
| parents | 77285bafc36a |
| children | 99c610473c17 |
comparison
equal
deleted
inserted
replaced
| 36:77285bafc36a | 37:33e5d444ff30 |
|---|---|
| 30 such a mercurial and git, may be cartoned this way (though note that newer | 30 such a mercurial and git, may be cartoned this way (though note that newer |
| 31 repositories may not be backwards-compatible with older clients). | 31 repositories may not be backwards-compatible with older clients). |
| 32 """ | 32 """ |
| 33 | 33 |
| 34 # imports | 34 # imports |
| 35 import optparse | |
| 35 import os | 36 import os |
| 36 import sys | 37 import sys |
| 37 import subprocess | 38 import subprocess |
| 38 import tarfile | 39 import tarfile |
| 39 import tempfile | 40 import tempfile |
| 40 import urllib2 | 41 import urllib2 |
| 41 from optparse import OptionParser | |
| 42 from StringIO import StringIO | 42 from StringIO import StringIO |
| 43 | 43 |
| 44 # global variables | 44 # global variables |
| 45 usage = "%prog [options] environment_name directory|url [...]" | 45 usage = "%prog [options] environment_name directory|url [...]" |
| 46 virtualenv_url = 'http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.6.1.tar.gz' | 46 virtualenv_url = 'http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.6.1.tar.gz' |
| 186 def format_description(self, description): | 186 def format_description(self, description): |
| 187 if description: | 187 if description: |
| 188 return description.strip() + '\n' | 188 return description.strip() + '\n' |
| 189 else: | 189 else: |
| 190 return '' | 190 return '' |
| 191 parser = OptionParser(usage=usage, description=__doc__) | 191 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) |
| 192 parser.add_option('-o', dest='outfile', | 192 parser.add_option('-o', dest='outfile', |
| 193 help="specify outfile; otherwise it will come from environment_name") | 193 help="specify outfile; otherwise it will come from environment_name") |
| 194 parser.add_option('-p', '--package', dest='package', | 194 parser.add_option('-p', '--package', dest='package', |
| 195 action='store_true', default=False, | 195 action='store_true', default=False, |
| 196 help="create python packages from sources; do not take entire subdirectory") | 196 help="create python packages from sources; do not take entire subdirectory") |
