Last change
on this file since 1363 was
1358,
checked in by mylan, 15 years ago
|
Added backward compatibility for pathing theme variables in egg_info/theme_vars.txt file
|
File size:
1.0 KB
|
Rev | Line | |
---|
[1005] | 1 | # |
---|
[1357] | 2 | import os |
---|
[1358] | 3 | import warnings |
---|
[1357] | 4 | from paste.script import pluginlib |
---|
[1005] | 5 | |
---|
| 6 | from quintagroup.themetemplate.qplone3_theme import qPlone3Theme |
---|
| 7 | |
---|
[1358] | 8 | warned = False |
---|
| 9 | |
---|
[1357] | 10 | def getEggInfo(output_dir): |
---|
| 11 | """ Return path to egg info directory, raise error if not found. |
---|
| 12 | """ |
---|
| 13 | egg_info = pluginlib.find_egg_info_dir(output_dir) |
---|
| 14 | assert egg_info is not None, "egg_info directory must present for the package" |
---|
[1005] | 15 | |
---|
[1357] | 16 | return egg_info |
---|
[1005] | 17 | |
---|
| 18 | |
---|
[1357] | 19 | def getThemeVarsFP(egg_info): |
---|
| 20 | """ Return file system path to theme vars configurations |
---|
| 21 | """ |
---|
[1358] | 22 | global warned |
---|
| 23 | old_path = os.path.join(egg_info, 'theme_vars.txt') |
---|
| 24 | if os.path.exists(old_path): |
---|
| 25 | if not warned: |
---|
| 26 | warnings.warn( |
---|
| 27 | "In 1.0 version theme variables from <the.theme.package>/theme_vars.cfg " \ |
---|
| 28 | "file only will be used. Currently " \ |
---|
| 29 | "<the.theme.package>/<the.theme.package>.egg_info/theme_vars.txt " \ |
---|
| 30 | "also supported." , DeprecationWarning, 2) |
---|
| 31 | warned = True |
---|
| 32 | return old_path |
---|
[1357] | 33 | return os.path.join(egg_info, '..', 'theme_vars.cfg') |
---|
Note: See
TracBrowser
for help on using the repository browser.