changeset 106:1295df1700a4

move stubbing around...maybe last minute will work better? ::shrug::
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 19:30:13 -0800
parents 67b50417b8d1
children 2142ad247eb6
files makeitso/makeitso.py
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/makeitso/makeitso.py	Tue Jan 11 19:23:53 2011 -0800
+++ b/makeitso/makeitso.py	Tue Jan 11 19:30:13 2011 -0800
@@ -17,15 +17,6 @@
 from ConfigParser import RawConfigParser
 from optparse import OptionParser
 
-# get templates from pkg_resources
-# (MakeItSo! and [TODO] pastescript templates)
-makeitso_templates = {}
-try:
-    from pkg_resources import iter_entry_points
-    for i in iter_entry_points('makeitso.templates'):
-        pass # :(
-except ImportError:
-    pass
 
 # URL of -this file-
 location = 'http://k0s.org/mozilla/hg/MakeItSo/raw-file/tip/makeitso/makeitso.py'
@@ -516,3 +507,16 @@
         
 if __name__ == '__main__':
     main()
+
+
+# get templates from pkg_resources
+# (MakeItSo! and [TODO] pastescript templates)
+# this should go last to ensure the module is wholly loaded
+def get_entry_points(name):
+    try:
+        from pkg_resources import iter_entry_points
+        for i in iter_entry_points('makeitso.templates'):
+            pass # :(
+
+    except ImportError:
+        return None