view decoupage/templates.py @ 6:6a802c87f070

mv decoupage to the web module bc thats where it should live; increment version
author k0s <k0scist@gmail.com>
date Thu, 24 Dec 2009 22:37:38 -0500
parents ea5a5ef8ae2e
children ffb7753bb7bf
line wrap: on
line source

#!/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'):
        import pdb; pdb.set_trace()
        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()