Ignore:
Timestamp:
Nov 1, 2009 11:07:11 AM (15 years ago)
Author:
mylan
Message:

#108: Refactored theme vars storage, some cleanup

Location:
quintagroup.themetemplate/trunk/quintagroup/themetemplate/localcommands
Files:
2 edited

Legend:

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

    r1005 r1357  
    44import os 
    55from ConfigParser import SafeConfigParser 
    6 from paste.script import pluginlib 
    76 
    87from zopeskel.base import var 
    98from zopeskel.localcommands import ZopeSkelLocalTemplate 
     9 
     10from quintagroup.themetemplate import getEggInfo 
     11from quintagroup.themetemplate import getThemeVarsFP 
    1012 
    1113class QThemeSubTemplate(ZopeSkelLocalTemplate): 
     
    5860 
    5961        res = {} 
    60         egg_info = pluginlib.find_egg_info_dir(output_dir) 
    61         theme_vars_fp = os.path.join(egg_info, 'theme_vars.txt') 
     62        egg_info = getEggInfo(output_dir) 
     63        theme_vars_fp = getThemeVarsFP(egg_info) 
    6264 
    63         if egg_info and os.path.exists(theme_vars_fp): 
     65        if os.path.exists(theme_vars_fp): 
    6466            config = SafeConfigParser() 
    6567            config.read(theme_vars_fp) 
     
    7779    def add_template_vars(self, output_dir, vars): 
    7880 
    79         egg_info = pluginlib.find_egg_info_dir(output_dir) 
    80         theme_vars_fp = os.path.join(egg_info, 'theme_vars.txt') 
     81        egg_info = getEggInfo(output_dir) 
     82        theme_vars_fp = getThemeVarsFP(egg_info) 
    8183 
    82         if egg_info and os.path.exists(theme_vars_fp): 
     84        if os.path.exists(theme_vars_fp): 
    8385            config = SafeConfigParser() 
    8486            config.read(theme_vars_fp) 
  • quintagroup.themetemplate/trunk/quintagroup/themetemplate/localcommands/subtemplates.py

    r1005 r1357  
    88from zopeskel.base import var 
    99from zopeskel.localcommands import ZopeSkelLocalTemplate 
     10 
     11from quintagroup.themetemplate import getEggInfo 
     12from quintagroup.themetemplate import getThemeVarsFP 
    1013from quintagroup.themetemplate.localcommands import QThemeSubTemplate 
    1114 
     
    156159    def add_order_tag(self, output_dir, vars, pmarker): 
    157160        need_update = True 
    158         egg_info = pluginlib.find_egg_info_dir(output_dir) 
    159         theme_vars_fp = os.path.join(egg_info, 'theme_vars.txt') 
    160  
    161         if egg_info and os.path.exists(theme_vars_fp): 
     161        egg_info = getEggInfo(output_dir) 
     162        theme_vars_fp = getThemeVarsFP(egg_info) 
     163 
     164        if os.path.exists(theme_vars_fp): 
    162165            config = SafeConfigParser() 
    163166            config.read(theme_vars_fp) 
     
    215218    def add_hidden_tag(self, output_dir, vars, pmarker): 
    216219        add_hidden = True 
    217         egg_info = pluginlib.find_egg_info_dir(output_dir) 
    218         theme_vars_fp = os.path.join(egg_info, 'theme_vars.txt') 
    219  
    220         if egg_info and os.path.exists(theme_vars_fp): 
     220        egg_info = getEggInfo(output_dir) 
     221        theme_vars_fp = getThemeVarsFP(egg_info) 
     222 
     223        if os.path.exists(theme_vars_fp): 
    221224            config = SafeConfigParser() 
    222225            config.read(theme_vars_fp) 
Note: See TracChangeset for help on using the changeset viewer.