# HG changeset patch # User k0s # Date 1261702114 18000 # Node ID 076b008ae580e02877c8aaace3ad9c563c0310c4 # Parent ec7abd0a57d9923b67dc8fdd310a8789db28f735# Parent ea5a5ef8ae2e67e61ab07065996d87c1539f6b9c merging diff -r ec7abd0a57d9 -r 076b008ae580 decoupage/templates.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/decoupage/templates.py Thu Dec 24 19:48:34 2009 -0500 @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import os +import sys +from optparse import OptionParser +from pkg_resources import iter_entry_points + +def template_dirs(): + template_dirs = set() + for formatter in iter_entry_points('decoupage.formatters'): + try: + formatter.load() + except: + continue + template_dir = resource_filename(formatter.module_name, 'templates') + if os.path.isdir(template_dir): + template_dirs.add(template_dir) + return template_dirs + +def main(args=sys.argv[1:]): + _template_dirs = template_dirs() + for d in _template_dirs: + print d + +if __name__ == '__main__': + main()