Changeset 1358 in products


Ignore:
Timestamp:
Nov 3, 2009 4:32:17 PM (14 years ago)
Author:
mylan
Message:

Added backward compatibility for pathing theme variables in egg_info/theme_vars.txt file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.themetemplate/trunk/quintagroup/themetemplate/__init__.py

    r1357 r1358  
    11# 
    22import os 
     3import warnings 
    34from paste.script import pluginlib 
    45 
    56from quintagroup.themetemplate.qplone3_theme import qPlone3Theme 
     7 
     8warned = False 
    69 
    710def getEggInfo(output_dir): 
     
    1720    """ Return file system path to theme vars configurations 
    1821    """ 
     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 
    1933    return os.path.join(egg_info, '..', 'theme_vars.cfg') 
Note: See TracChangeset for help on using the changeset viewer.