Changeset 14171 for trunk


Ignore:
Timestamp:
05/14/12 16:54:33 (12 years ago)
Author:
ramonb
Message:

sara_cmt/bin/cmt,
sara_cmt/sara_cmt/logger.py,
sara_cmt/sara_cmt/settings.py:

  • apply same ETC_PREPEND location as in setup.py to source code
  • see #14
Location:
trunk/sara_cmt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sara_cmt/bin/cmt

    r14154 r14171  
    8181#TODO: think about a (better) way to make this dynamic:
    8282import site
    83 configfile = '%s/etc/cmt/cmt.conf' % site.sys.prefix
     83
     84if site.sys.prefix in [ '/usr', '/' ]:
     85    ETC_PREPEND = ''
     86else:
     87    ETC_PREPEND = site.sys.prefix
     88
     89configfile = '%s/etc/cmt/cmt.conf' % ETC_PREPEND
    8490config_parser = ConfigParser.ConfigParser()
    8591config_parser.optionxform = lambda x: x
  • trunk/sara_cmt/sara_cmt/logger.py

    r14154 r14171  
    1515        #TODO: think about a (better) way to make this dynamic:
    1616        import site
    17         logging.config.fileConfig('%s/etc/cmt/logging.conf'%site.sys.prefix)
     17
     18        if site.sys.prefix in [ '/usr', '/' ]:
     19            ETC_PREPEND = ''
     20        else:
     21            ETC_PREPEND = site.sys.prefix
     22
     23        logging.config.fileConfig('%s/etc/cmt/logging.conf'%ETC_PREPEND)
    1824        __shared_state['logger'] = logging.getLogger('cli')
    1925
  • trunk/sara_cmt/sara_cmt/settings.py

    r14165 r14171  
    44from socket import gethostbyname_ex
    55
     6if site.sys.prefix in [ '/usr', '/' ]:
     7    ETC_PREPEND = ''
     8else:
     9    ETC_PREPEND = site.sys.prefix
     10
    611# Path's customizable through virtualenv
    7 sample_configfile = '%s/etc/cmt/cmt.conf.sample' % site.sys.prefix
    8 configfile = '%s/etc/cmt/cmt.conf' % site.sys.prefix
     12sample_configfile = '%s/etc/cmt/cmt.conf.sample' % ETC_PREPEND
     13configfile = '%s/etc/cmt/cmt.conf' % ETC_PREPEND
    914
    1015def count_configlines( filename ):
     
    248253#TODO: think about a (better) way to make this dynamic:
    249254#TODO: get this out of the settings.py, since it should be in the client config
    250 CMT_TEMPLATES_DIR = '%s/etc/cmt/templates' % site.sys.prefix
     255CMT_TEMPLATES_DIR = '%s/etc/cmt/templates' % ETC_PREPEND
    251256
    252257# Templates for the CMT web-frontend.
Note: See TracChangeset for help on using the changeset viewer.