diff makeitso/makeitso.py @ 28:dc18d6db4956

depend on trunk tempita; stubbing for next stage
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 22 Dec 2010 13:30:09 -0800
parents ac44c36da885
children 1549be7f0fcb
line wrap: on
line diff
--- a/makeitso/makeitso.py	Tue Dec 14 22:46:56 2010 -0800
+++ b/makeitso/makeitso.py	Wed Dec 22 13:30:09 2010 -0800
@@ -133,6 +133,8 @@
         print 'Enter %s: ' % i,
         retval[i] = raw_input()
     return retval
+
+### functions for substitution
         
 def substitute(content, variables=None):
     """interactive (for now) substitution"""
@@ -149,6 +151,11 @@
         variables.update(read_variables(missing))
     return template.substitute(**variables)
 
+def substitute_directory(directory, output=None, variables=None):
+    # TODO: interpolate directory names
+
+###
+
 def invocation(url, **variables):
     """returns a string appropriate for TTW invocation"""
     variables_string = ' '.join(['%s=%s' % (i,j) for i,j in variables.items()])
@@ -159,13 +166,22 @@
     # create option parser
     usage = '%prog [options] template <template> <...>'
     parser = OptionParser(usage, description=__doc__)
+
+    # delimeters
+    # XXX needs tempita trunk
     parser.add_option('-[', '--start-braces', dest='start_braces',
                       help='starting delimeter')
     parser.add_option('-]', '--end-braces', dest='end_braces',
                       help='starting delimeter')
+
+    # options about where to put things
     parser.add_option('--in-place', dest='in_place',
                       action='store_true', default=False,
                       help='interpret files in place') # TODO: unused
+    parser.add_option('-o', '--output', dest='output',
+                      help='where to put the output (filename or directory)')
+
+    # 
     parser.add_option('--commandline', dest='commandline',
                       action='store_true', default=False,
                       help="print the commandline to invoke this script TTW")