diff contenttransformer/utils.py @ 16:6cbe4172b54b

sketch of how to hook up imports for genshi transformer
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 24 Sep 2010 19:15:13 -0700
parents
children 466443d48906
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contenttransformer/utils.py	Fri Sep 24 19:15:13 2010 -0700
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+def import_path(module):
+  path = module.split('.')
+  module = __import__(path[0])
+  for name in path[1:]:
+    module = getattr(module, name)
+  return module
+
+if __name__ == '__main__':
+  import sys
+  for i in sys.argv[1:]:
+    print import_path(i)