Пример #1
0
# Execute initializations in the base module.
import vac_templater

# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
ugettext = lambda s: s

###############################################################################
## CONFIGURATION.
###############################################################################

_config_filename = os.environ.get('VAC_TEMPLATER_CONF',
                                  '/etc/vac-templater.conf')
_config = ConfigParser.ConfigParser()
_config.readfp(StringIO(default_config()))
try:
    _config.read([_config_filename])
except:
    sys.exit("Error: failed to load configuration file '%(file)s'." % {
        'file': _config_filename,
    })

###############################################################################
## ENVIRONMENT.
###############################################################################

DEBUG = _config.getboolean('global', 'debug')

if _config.getboolean('global', 'development'):
    ENVIRONMENT = 'development'
Пример #2
0
 def handle(self, *args, **options):
     self.stdout.write(default_config())
Пример #3
0
ROOT = path(__file__).abspath().dirname()

# Execute initializations in the base module.
import vac_templater

# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
ugettext = lambda s: s

###############################################################################
## CONFIGURATION.
###############################################################################

_config_filename = os.environ.get('VAC_TEMPLATER_CONF', '/etc/vac-templater.conf')
_config = ConfigParser.ConfigParser()
_config.readfp(StringIO(default_config()))
try:
    _config.read([_config_filename])
except:
    sys.exit("Error: failed to load configuration file '%(file)s'." % {
        'file': _config_filename,
    })

###############################################################################
## ENVIRONMENT.
###############################################################################

DEBUG = _config.getboolean('global', 'debug')

if _config.getboolean('global', 'development'):
    ENVIRONMENT = 'development'
Пример #4
0
 def handle(self, *args, **options):
     self.stdout.write(default_config())