# HG changeset patch # User Jeff Hammel # Date 1289528384 28800 # Node ID a77630b2b491fb080ff01a5c2f21a99d5bd78df5 # Parent 157df8d1c3ed50608fde3f7fb0a4d70e20860e22 * add commandline to print commandlines * add commandline option to print all variables diff -r 157df8d1c3ed -r a77630b2b491 makeitso/makeitso.py --- a/makeitso/makeitso.py Thu Nov 11 16:33:27 2010 -0800 +++ b/makeitso/makeitso.py Thu Nov 11 18:19:44 2010 -0800 @@ -11,6 +11,10 @@ from optparse import OptionParser from tempita import Template +# URL of this file +location = 'http://k0s.org/mozilla/hg/MakeItSo/raw-file/tip/makeitso/makeitso.py' + +# regular expressions for finding the shebang shebang_re = '#!.*makeitso.*' shebang_re = re.compile(shebang_re) @@ -80,18 +84,42 @@ variables.update(read_variables(missing)) print >> fp, template.substitute(**variables) +def invocation(url, **variables): + """returns a string appropriate for TTW invocation""" + variables_string = ' '.join(['%s=%s' % (i,j) for i,j in variables.items()]) + return 'python <(curl %s) %s %s' % (location, url, variables_string) def main(args=sys.argv[1:]): # create option parser - usage = '%prog [options]' + usage = '%prog [options] template