~openerp-dev/openobject-server/trunk-gunicorn-signaling-vmt

« back to all changes in this revision

Viewing changes to openerp/tools/config.py

  • Committer: Vo Minh Thu
  • Date: 2012-03-07 11:10:30 UTC
  • mfrom: (4001.1.83 server)
  • Revision ID: vmt@openerp.com-20120307111030-8hzhzm0zoo34nuj7
[MERGE] merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
                         help="Launch a YML test file.")
169
169
        group.add_option("--test-report-directory", dest="test_report_directory", my_default=False,
170
170
                         help="If set, will save sample of all reports in this directory.")
171
 
        group.add_option("--test-disable", action="store_true", dest="test_disable",
172
 
                         my_default=False, help="Disable loading test files.")
 
171
        group.add_option("--test-enable", action="store_true", dest="test_enable",
 
172
                         my_default=False, help="Enable YAML and unit tests.")
173
173
        group.add_option("--test-commit", action="store_true", dest="test_commit",
174
 
                         my_default=False, help="Commit database changes performed by tests.")
175
 
        group.add_option("--assert-exit-level", dest='assert_exit_level', type="choice", choices=self._LOGLEVELS.keys(),
176
 
                         my_default='error',
177
 
                         help="specify the level at which a failed assertion will stop the server. Accepted values: %s" % (self._LOGLEVELS.keys(),))
 
174
                         my_default=False, help="Commit database changes performed by YAML or XML tests.")
178
175
        parser.add_option_group(group)
179
176
 
180
177
        # Logging Group
395
392
            'debug_mode', 'smtp_ssl', 'load_language',
396
393
            'stop_after_init', 'logrotate', 'without_demo', 'netrpc', 'xmlrpc', 'syslog',
397
394
            'list_db', 'xmlrpcs', 'proxy_mode',
398
 
            'test_file', 'test_disable', 'test_commit', 'test_report_directory',
 
395
            'test_file', 'test_enable', 'test_commit', 'test_report_directory',
399
396
            'osv_memory_count_limit', 'osv_memory_age_limit', 'max_cron_threads',
400
397
            'virtual_memory_limit', 'virtual_memory_reset', 'cpu_time_limit', 'unaccent',
401
398
        ]
408
405
            elif isinstance(self.options[arg], basestring) and self.casts[arg].type in optparse.Option.TYPE_CHECKER:
409
406
                self.options[arg] = optparse.Option.TYPE_CHECKER[self.casts[arg].type](self.casts[arg], arg, self.options[arg])
410
407
 
411
 
        if opt.assert_exit_level:
412
 
            self.options['assert_exit_level'] = self._LOGLEVELS[opt.assert_exit_level]
413
 
        else:
414
 
            self.options['assert_exit_level'] = self._LOGLEVELS.get(self.options['assert_exit_level']) or int(self.options['assert_exit_level'])
415
 
 
416
408
        self.options['root_path'] = os.path.abspath(os.path.expanduser(os.path.expandvars(os.path.dirname(openerp.__file__))))
417
409
        if not self.options['addons_path'] or self.options['addons_path']=='None':
418
410
            self.options['addons_path'] = os.path.join(self.options['root_path'], 'addons')
582
574
                continue
583
575
            if opt in self.blacklist_for_save:
584
576
                continue
585
 
            if opt in ('log_level', 'assert_exit_level'):
 
577
            if opt in ('log_level',):
586
578
                p.set('options', opt, loglevelnames.get(self.options[opt], self.options[opt]))
587
579
            else:
588
580
                p.set('options', opt, self.options[opt])