Changeset 4600

Show
Ignore:
Timestamp:
05/23/08 07:58:03 (8 months ago)
Author:
deets
Message:

Fixed #1781

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/turbogears/command/i18n.py

    r3734 r4600  
    2626from turbogears.util import get_model, load_project_config, get_package_name 
    2727from pkg_resources import resource_filename 
    28 import kid 
     28# FIXME-dbr: we need to make kid-support pluggable or such. 
     29try: 
     30    import kid 
     31except ImportError: 
     32    pass 
    2933 
    3034class ProgramError(StandardError): 
  • branches/1.1/turbogears/i18n/__init__.py

    r3367 r4600  
    1111    get_abbr_weekday_names, get_languages, format_date, format_number, \ 
    1212    format_decimal, format_currency, parse_number, parse_decimal 
    13 from turbogears.i18n.kidutils import translate, i18n_filter 
     13# FIXME-dbr: we need to make kid-support pluggable or such. 
     14try: 
     15    from turbogears.i18n.kidutils import translate, i18n_filter 
     16except ImportError: 
     17    def i18n_filter(stream, template, locale=None): 
     18        raise Exception("the i18n_filter is currently KID-only") 
  • branches/1.1/turbogears/widgets/meta.py

    r4184 r4600  
    22import copy 
    33import warnings 
    4 import kid 
     4 
     5# FIXME-dbr: we need to make kid-support pluggable or such. 
     6try: 
     7    import kid 
     8except ImportError: 
     9    pass 
    510from new import instancemethod 
    611from itertools import ifilter, count 
     
    162167# XXX: Maybe Widget should have a __del__ method to unload any template that 
    163168#      has been loaded during the instances initialization? 
     169# FIXME-dbr: This is returning nonsens in case KID isn't imported because 
     170# we want to get rid of KID as a dependency - and as long as the widgets 
     171# are in TG itself, that leads no not-so-beautiful compromises. 
    164172def load_kid_template(t, modname=None): 
    165173    """ 
     
    168176    Returns a tuple (compiled_tmpl, template_text (or modulepath) 
    169177    """ 
     178    # this is a dummy-value-return-thingy, see above comment 
     179    try: 
     180        kid 
     181    except NameError: 
     182        return None, None 
     183     
    170184    if isinstance(t, basestring) and "<" in t: 
    171185        if not modname: