Mercurial > hg > contenttransformer
comparison 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 |
comparison
equal
deleted
inserted
replaced
15:946176949bba | 16:6cbe4172b54b |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 def import_path(module): | |
4 path = module.split('.') | |
5 module = __import__(path[0]) | |
6 for name in path[1:]: | |
7 module = getattr(module, name) | |
8 return module | |
9 | |
10 if __name__ == '__main__': | |
11 import sys | |
12 for i in sys.argv[1:]: | |
13 print import_path(i) |