def __init__(self, options={}): ECMDSConfigReader.__init__(self) ECMDSDTDResolver.__init__(self) ECMDSPreprocessor.__init__(self) self.readConfig(options) self.loadPlugins() self.loadStylesheet()
def __init__(self, options={}): ECMDSConfigReader.__init__(self) ECMDSDTDResolver. __init__(self) ECMDSPreprocessor.__init__(self) self.readConfig(options) self.loadPlugins() self.loadStylesheet()
def test_loadNonFromNonExistentInstallDir(self): options = {"install_dir": "/no/such/directory"} try: config, pmap = ECMDSConfigReader().readConfig(options) except ECMDSConfigError as e: self.assertEqual( e.msg(), "Please specify the location of the config file.") else: self.assertTrue(False)
def test_loadConfigurationAndCheckResult(self): expected_config = { 'base_dir': ECMDS_INSTALL_DIR, 'convert_bin': '/usr/bin/convert', 'convert_dpi': '300', 'data_dir': ECMDS_INSTALL_DIR + '/data', 'do_validate': True, 'dvipng_bin': '/usr/bin/dvipng', 'dvipng_dpi': '90', 'identify_bin': '/usr/bin/identify', 'install_dir': ECMDS_INSTALL_DIR + '', 'latex_bin': '/usr/bin/latex', 'lib_dir': ECMDS_INSTALL_DIR + '/lib', 'plugin_dir': ECMDS_INSTALL_DIR + '/lib/net/ecromedos/plugins', 'style_dir': ECMDS_INSTALL_DIR + '/xslt', 'target_format': 'xhtml', 'pygments_default_colorscheme': 'monokai' } expected_pmap = { '@text': ['text'], 'article': ['data'], 'author': ['strip'], 'book': ['data'], 'caption': ['strip'], 'code': ['strip', 'highlight', 'verbatim', 'final'], 'date': ['strip'], 'dd': ['strip'], 'dedication': ['strip'], 'defterm': ['glossary', 'final'], 'dt': ['strip'], 'equation': ['strip'], 'idxterm': ['index', 'final'], 'img': ['picture'], 'li': ['strip'], 'm': ['math'], 'make-glossary': ['glossary'], 'make-index': ['index'], 'p': ['strip'], 'publisher': ['strip'], 'report': ['data'], 'subject': ['strip'], 'subtable': ['table'], 'table': ['table'], 'td': ['strip'], 'title': ['strip'], 'verbatim': ['strip', 'verbatim', 'final'] } options = {"install_dir": ECMDS_INSTALL_DIR} config, pmap = ECMDSConfigReader().readConfig(options) self.assertEqual(config, expected_config) self.assertEqual(pmap, expected_pmap)
def __init__(self, options): ECMDSConfigReader.__init__(self) ECMDSDTDResolver.__init__(self) self.config = { "document_type": "report", "bcor": "0cm", "div": "16", "lang": "en_US", "papersize": "a4", "parskip": "half", "secnumdepth": "2", "secsplitdepth": "1", "header": "", "tocdepth": "5", "have_lof": "no", "have_lot": "no", "have_lol": "no", "contents": "" } self.config.update(options)
def __init__(self, options): ECMDSConfigReader.__init__(self) ECMDSDTDResolver. __init__(self) self.readConfig(options) self.document_settings = { "document_type": "report", "bcor": "0cm", "div": "16", "lang": "en_US", "papersize": "a4", "parskip": "half", "secnumdepth": "2", "secsplitdepth": "1", "header": "", "tocdepth": "5", "have_lof": "no", "have_lot": "no", "have_lol": "no", "contents": "" } self.user_settings = options