Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2443: meta.patch

File meta.patch, 1.1 KB (added by xaka, 2 years ago)
  • turbogears/widgets/meta.py

    old new  
    8080            cls.__init__ = dct["__init__"] 
    8181        super(MetaWidget, cls).__init__(name, bases, dct) 
    8282        modname = "%s.%s" % (cls.__module__, name) 
     83        modname = "%s-%s" % (modname, get_mod_index(modname)) 
    8384        if cls.template: 
    8485            (cls.template_c, 
    8586             cls.template) = load_kid_template(cls.template, modname) 
    8687        cls._locked = False 
    8788 
     89modcounter = {} 
     90def get_mod_index(modname): 
     91    from itertools import count 
     92    return modcounter.setdefault(modname, count(1)).next() 
     93 
    8894############################################################################# 
    8995# Method decorators and other MetaWidget helpers                            # 
    9096#############################################################################