本文整理汇总了Python中Legacy.Config.parse_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Config.parse_directory方法的具体用法?Python Config.parse_directory怎么用?Python Config.parse_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Legacy.Config
的用法示例。
在下文中一共展示了Config.parse_directory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import parse_directory [as 别名]
def setUp(self):
Config.parse_directory(os.path.abspath("../ConfDir"))
Config.load_user()
self.db = DataBase("//localhost/Internal")
self.output = cStringIO.StringIO()
self.mapping = Config.get("ovid/mapping").data
示例2: setUp
# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import parse_directory [as 别名]
def setUp (self):
Config.parse_directory (os.path.abspath('../ConfDir'))
Config.load_user ()
print 'CONFIGURATION'
print 50*'-'
for i in Config.domains ():
print i, Config.keys_in_domain (i)
print 'END', 50*'-'
self.db = Base.DataBase ('//localhost/Internal')
self.output = cStringIO.StringIO()
示例3:
# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import parse_directory [as 别名]
# -*- coding: iso8859-1 -*-
import cStringIO, os, sys, unittest
import locale
locale.setlocale (locale.LC_ALL, '')
import gettext
gettext.install ('pybliographer', '/usr/local/share/locale', unicode = True)
sys.path.append (os.path.abspath('../..'))
from Legacy import Base, Config, Fields
Config.parse_directory (os.path.abspath('../ConfDir'))
Config.load_user ()
from Legacy.Format import Medline
example_1 = """PMID- 15985842
OWN - NLM
STAT- MEDLINE
DA - 20050629
DCOM- 20050805
PUBM- Print
IS - 0022-3018
VI - 193
示例4:
# 需要导入模块: from Legacy import Config [as 别名]
# 或者: from Legacy.Config import parse_directory [as 别名]
Autoload.preregister ('format', 'ISIFile', 'Legacy.Format.isifile', '.*\.isi')
# define styles and outputs
Autoload.preregister ('style', 'Generic', 'Legacy.Style.Generic')
Autoload.preregister ('style', 'apa4e', 'Legacy.Style.apa4e')
Autoload.preregister ('style', 'abbrv', 'Legacy.Style.abbrv')
Autoload.preregister ('output', 'Text', 'Legacy.Output.text')
Autoload.preregister ('output', 'Raw', 'Legacy.Output.raw')
Autoload.preregister ('output', 'HTML', 'Legacy.Output.html')
Autoload.preregister ('output', 'LaTeX', 'Legacy.Output.LaTeX')
Autoload.preregister ('output', 'Textnum', 'Legacy.Output.textnum')
Autoload.preregister ('output', 'Textau', 'Legacy.Output.textau')
# define key formats
Autoload.preregister('key', 'Default', 'Legacy.Utils')
# Parse the configuration directory
rootconfig = os.path.join ('Legacy', 'ConfDir')
if not os.path.isdir (rootconfig):
rootconfig = os.path.join (version.pybdir, 'Legacy', 'ConfDir')
if os.path.isdir (rootconfig):
Config.parse_directory (rootconfig)