diff makeitso/makeitso.py @ 33:190f310f2f5e

more stubbing of template classes
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 22 Dec 2010 18:51:08 -0800
parents 9422d4ad6c2c
children 46c2d0a7335a
line wrap: on
line diff
--- 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()