#11539 closed defect (fixed)
Skipping "themeengine.admin" with Trac 0.12.x
Reported by: | Jun Omae | Owned by: | Olemis Lang |
---|---|---|---|
Priority: | normal | Component: | ThemeEnginePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
I think the plugin should work with Trac 0.12.x or create themeengineplugin/0.12
branch.
If you want to work with Trac 0.12.x, the following would help you. source:tracworkflowadminplugin/0.12/tracworkflowadmin/web_ui.py@13611#L35.
2014-02-03 14:37:26,035 Trac[loader] ERROR: Skipping "themeengine.admin = themeengine.admin": Traceback (most recent call last): File "/home/jun66j5/venv/trac/0.12.5/lib/python2.4/site-packages/trac/loader.py", line 68, in _load_eggs entry.load(require=True) File "/home/jun66j5/venv/trac/0.12.5/lib/python2.4/site-packages/distribute-0.6.15-py2.4.egg/pkg_resources.py", line 1954, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/home/jun66j5/src/trac/trac-hacks/themeengineplugin/trunk/themeengine/admin.py", line 21, in ? from themeengine.api import ThemeEngineSystem, ThemeNotFound File "/home/jun66j5/src/trac/trac-hacks/themeengineplugin/trunk/themeengine/api.py", line 88, in ? class ThemeEngineSystem(Component): File "/home/jun66j5/src/trac/trac-hacks/themeengineplugin/trunk/themeengine/api.py", line 93, in ThemeEngineSystem doc_domain='themeengine') TypeError: __init__() got an unexpected keyword argument 'doc_domain'
Attachments (0)
Change History (10)
comment:1 Changed 11 years ago by
Status: | new → assigned |
---|
comment:3 Changed 11 years ago by
@jun66j5 : could you please report if everything is back to normal now ?
comment:4 follow-up: 5 Changed 11 years ago by
I tried the latest. That issue goes away. But another issue on Trac 0.12.5 with Python 2.4.
File "/home/jun66j5/src/trac/trac-hacks/themeengineplugin/trunk/themeengine/translation.py", line 27 if trac_version[:2] >= (1, 0) else {} ^ SyntaxError: invalid syntax (translation.py, line 27)
-
themeengine/translation.py
9 9 10 10 """Translation functions and classes.""" 11 11 12 from pkg_resources import parse_version 13 12 14 from trac import __version__ as trac_version 13 15 from trac.util.translation import domain_functions 14 16 15 trac_version = tuple(int(x) for x in trac_version.split()16 if x[0] in '0123456789')17 18 17 #------------------------------------------------------ 19 18 # Internationalization 20 19 #------------------------------------------------------ … … 23 22 domain_functions('themeengine', ('_', 'ngettext', 'tag_', 'tagn_', 24 23 'gettext', 'N_', 'add_domain')) 25 24 26 I18N_DOC_OPTIONS = dict(doc_domain='themeengine') \27 if trac_version[:2] >= (1, 0) else {} 28 25 I18N_DOC_OPTIONS = {} 26 if parse_version(trac_version) >= parse_version('1.0'): 27 I18N_DOC_OPTIONS['doc_domain'] = 'themeengine'
Also extract_messages
command extracts no translation messages.
$ ~/venv/trac/1.0.1/bin/python setup.py extract_messages
running extract_messages
writing PO template file to themeengine/locale/messages.pot
$ msgfmt -v themeengine/locale/messages.pot
0 translated messages.
-
setup.py
26 26 }), 27 27 ] 28 28 extra['message_extractors'] = { 29 ' bhdashboard': extractors,29 'themeengine': extractors, 30 30 } 31 31 except ImportError: 32 32 pass
After the above patch, 14 messages would be extracted.
$ ~/venv/trac/1.0.1/bin/python setup.py extract_messages running extract_messages extracting messages from themeengine/__init__.py extracting messages from themeengine/admin.py extracting messages from themeengine/api.py extracting messages from themeengine/translation.py extracting messages from themeengine/web_ui.py extracting messages from themeengine/templates/admin_theme.html extracting messages from themeengine/templates/admin_theme_advanced.html extracting messages from themeengine/templates/admin_theme_custom.html extracting messages from themeengine/tests/__init__.py extracting messages from themeengine/tests/api.py writing PO template file to themeengine/locale/messages.pot $ msgfmt -v themeengine/locale/messages.pot 0 translated messages, 14 untranslated messages.
comment:5 follow-up: 8 Changed 11 years ago by
Replying to jun66j5:
I tried the latest. That issue goes away. But another issue on Trac 0.12.5 with Python 2.4.
File "/home/jun66j5/src/trac/trac-hacks/themeengineplugin/trunk/themeengine/translation.py", line 27 if trac_version[:2] >= (1, 0) else {} ^ SyntaxError: invalid syntax (translation.py, line 27)
Should we still support such an old version of Python ? ... anyway it's a simple improvement . I'll fix that .
[... patch (themeengine/translation.py) ...]
... yeah this is a much better solution , I did not know exactly how to deal with version numbers and suffices like dev
...
Also
extract_messages
command extracts no translation messages.
[...]
my big mistake , sorry .
Thanks for the review !
comment:8 follow-up: 9 Changed 11 years ago by
Should we still support such an old version of Python ? ... anyway it's a simple improvement . I'll fix that .
Trac 0.12.x supports Python 2.4. Python in RHEL/CentOS 5 is 2.4 and the distributions are maintained. Python 2.4 is old version but that is normally used.
If a plugin supports Trac 0.12 and it isn't difficult to support Python 2.4, I think it must work on Python 2.4.
If a plugin doesn't support Python 2.4 and I need it, I probably will fork it. e.g. https://github.com/jun66j5/pygit2/tree/master-py24 (pygit2 requires 2.6+).
comment:9 Changed 11 years ago by
Replying to jun66j5:
Should we still support such an old version of Python ? ... anyway it's a simple improvement . I'll fix that .
Trac 0.12.x supports Python 2.4. Python in RHEL/CentOS 5 is 2.4 and the distributions are maintained. Python 2.4 is old version but that is normally used.
If a plugin supports Trac 0.12 and it isn't difficult to support Python 2.4, I think it must work on Python 2.4.
If a plugin doesn't support Python 2.4 and I need it, I probably will fork it. e.g. https://github.com/jun66j5/pygit2/tree/master-py24 (pygit2 requires 2.6+).
It's ok then . I'll take that into account from now on .
I cannot accept the ticket
/me working on it ...