cwconfig.py
changeset 10474 1dcc52f5e340
parent 10411 4ee15441f2eb
child 10477 ee21c559f94f
equal deleted inserted replaced
10473:23a2fa8cb725 10474:1dcc52f5e340
   833     # wouldn't be possible otherwise
   833     # wouldn't be possible otherwise
   834     repairing = False
   834     repairing = False
   835 
   835 
   836     # set by upgrade command
   836     # set by upgrade command
   837     verbosity = 0
   837     verbosity = 0
   838 
   838     cmdline_options = None
   839     options = CubicWebNoAppConfiguration.options + (
   839     options = CubicWebNoAppConfiguration.options + (
   840         ('log-file',
   840         ('log-file',
   841          {'type' : 'string',
   841          {'type' : 'string',
   842           'default': Method('default_log_file'),
   842           'default': Method('default_log_file'),
   843           'help': 'file where output logs should be written',
   843           'help': 'file where output logs should be written',
  1027         super(CubicWebConfiguration, self).init_cubes(cubes)
  1027         super(CubicWebConfiguration, self).init_cubes(cubes)
  1028         # reload config file in cases options are defined in cubes __init__
  1028         # reload config file in cases options are defined in cubes __init__
  1029         # or site_cubicweb files
  1029         # or site_cubicweb files
  1030         self.load_file_configuration(self.main_config_file())
  1030         self.load_file_configuration(self.main_config_file())
  1031         # configuration initialization hook
  1031         # configuration initialization hook
  1032         self.load_configuration()
  1032         self.load_configuration(**(self.cmdline_options or {}))
  1033 
  1033 
  1034     def add_cubes(self, cubes):
  1034     def add_cubes(self, cubes):
  1035         """add given cubes to the list of used cubes"""
  1035         """add given cubes to the list of used cubes"""
  1036         if not isinstance(cubes, list):
  1036         if not isinstance(cubes, list):
  1037             cubes = list(cubes)
  1037             cubes = list(cubes)
  1094             version = self.cube_version(pkg)
  1094             version = self.cube_version(pkg)
  1095             infos.append('%s-%s' % (pkg, version))
  1095             infos.append('%s-%s' % (pkg, version))
  1096         infos.append('cubicweb-%s' % str(self.cubicweb_version()))
  1096         infos.append('cubicweb-%s' % str(self.cubicweb_version()))
  1097         return md5(';'.join(infos)).hexdigest()
  1097         return md5(';'.join(infos)).hexdigest()
  1098 
  1098 
  1099     def load_configuration(self):
  1099     def load_configuration(self, **kw):
  1100         """load instance's configuration files"""
  1100         """load instance's configuration files"""
  1101         super(CubicWebConfiguration, self).load_configuration()
  1101         super(CubicWebConfiguration, self).load_configuration(**kw)
  1102         if self.apphome and not self.creating:
  1102         if self.apphome and not self.creating:
  1103             # init gettext
  1103             # init gettext
  1104             self._gettext_init()
  1104             self._gettext_init()
  1105 
  1105 
  1106     def _load_site_cubicweb(self, sitefile):
  1106     def _load_site_cubicweb(self, sitefile):