# HG changeset patch # User Jeff Hammel # Date 1293072668 28800 # Node ID 190f310f2f5e97e76f88b76d416d87c7feb46802 # Parent 9422d4ad6c2c9eda4a2d42e41ba9e16c8e79244e more stubbing of template classes diff -r 9422d4ad6c2c -r 190f310f2f5e makeitso/makeitso.py --- a/makeitso/makeitso.py Wed Dec 22 18:46:45 2010 -0800 +++ b/makeitso/makeitso.py Wed Dec 22 18:51:08 2010 -0800 @@ -15,9 +15,11 @@ from optparse import OptionParser -# URL of this file +# URL of -this file- location = 'http://k0s.org/mozilla/hg/MakeItSo/raw-file/tip/makeitso/makeitso.py' +### import tempita + # URL of tempita tempita_location = 'http://bitbucket.org/ianb/tempita/raw-file/tip/tempita/' @@ -25,7 +27,6 @@ # remove temporary net module directory if 'tempdir' in globals(): shutil.remove(tempdir) - try: import tempita except ImportError: @@ -90,22 +91,6 @@ def __init__(self, message, missing): self.missing = missing -class ContentTemplate(tempita.Template): - """MakeItSo's extension of tempita's Template class""" - defaults = {'include': include} - def __init__(self): - raise NotImplementedError - -class URITemplate(tempita.Template): - - def __init__(self, interactive=True): - # TODO: automagically tell if the program is interactive or not - raise NotImplementedError - -class DirectoryTemplate(tempita.Template): - def __init__(self): - raise NotImplementedError - def get_missing(name_error): """ This is a horrible hack because python doesn't do the proper thing @@ -120,6 +105,26 @@ varname = message.split("'")[1] return varname +### template classes + +class ContentTemplate(tempita.Template): + """MakeItSo's extension of tempita's Template class""" + defaults = {'include': include} + def __init__(self, content, interactive=True): + tempita.Template.__init__(self, content) + # TODO: automagically tell if the program is interactive or not + self.interactive = True + raise NotImplementedError + +class URITemplate(tempita.Template): + + def __init__(self, interactive=True): + raise NotImplementedError + +class DirectoryTemplate(tempita.Template): + def __init__(self): + raise NotImplementedError + def missing_variables(template, variables): """return additional variables needed""" vars = variables.copy()