本文整理汇总了Python中configuration.Configuration.check_parameters方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.check_parameters方法的具体用法?Python Configuration.check_parameters怎么用?Python Configuration.check_parameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.check_parameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_id_filename
# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import check_parameters [as 别名]
# /var/www/lildbibio_scielo_org/bases/bhl/archive/db/i105944.xml
def generate_id_filename(self, xml_filename, id_filename):
self.bhl2json.generate_id_filename(xml_filename, id_filename)
if __name__ == "__main__":
# paths = ['/var/www/lildbibio_scielo_org/proc/xml_path/new', '/var/www/lildbibio_scielo_org/proc/xml_path/inproc', '/var/www/lildbibio_scielo_org/proc/xml_path/archive' ]
# paths = ['/var/www/lildbibio_scielo_org/proc/teste/new', 'i', 't' ]
# python3 bhl_lilacs.py /var/www/lildbibio_scielo_org/bases/cisis1660 /var/www/lildbibio_scielo_org/bases/bhl/bhl /var/www/lildbibio_scielo_org/proc/bhl_lilacs /var/www/lildbibio_scielo_org/bases/bhl/bhl_xml
from utils.parameters import Parameters
from utils.report import Report
from configuration import Configuration
configuration = Configuration("configuration.ini")
if configuration.check_parameters(["CISIS_PATH", "REPORT_PATH", "INBOX_PATH", "ARCHIVE_PATH", "DB_FILENAME"]):
cisis_path, report_path, inbox_path, archive_path, db_filename = configuration.return_parameters(
["CISIS_PATH", "REPORT_PATH", "INBOX_PATH", "ARCHIVE_PATH", "DB_FILENAME"]
)
parameter_list = ["", "source of xml files: new|archive"]
parameters = Parameters(parameter_list)
if parameters.check_parameters(sys.argv):
script, xml_source = sys.argv
if xml_source != "archived" or xml_source != "new":
xml_source = "new"
cisis = CISIS(cisis_path)
files_set = BHL_Files_Set(inbox_path, archive_path)
示例2: Configuration
# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import check_parameters [as 别名]
self.bhl2json.generate_id_filename(xml_filename, id_filename)
if __name__ == '__main__':
#paths = ['/var/www/lildbibio_scielo_org/proc/xml_path/new', '/var/www/lildbibio_scielo_org/proc/xml_path/inproc', '/var/www/lildbibio_scielo_org/proc/xml_path/archive' ]
#paths = ['/var/www/lildbibio_scielo_org/proc/teste/new', 'i', 't' ]
#python3 bhl_lilacs.py /var/www/lildbibio_scielo_org/bases/cisis1660 /var/www/lildbibio_scielo_org/bases/bhl/bhl /var/www/lildbibio_scielo_org/proc/bhl_lilacs /var/www/lildbibio_scielo_org/bases/bhl/bhl_xml
from utils.parameters import Parameters
from utils.report import Report
from configuration import Configuration
configuration = Configuration('configuration.ini')
if configuration.check_parameters(['CISIS_PATH', 'REPORT_PATH', 'INBOX_PATH', 'ARCHIVE_PATH', 'DB_FILENAME']):
cisis_path, report_path, inbox_path, archive_path, db_filename = configuration.return_parameters(['CISIS_PATH', 'REPORT_PATH', 'INBOX_PATH', 'ARCHIVE_PATH', 'DB_FILENAME'])
parameter_list = ['', 'source of xml files: new|archive' ]
parameters = Parameters(parameter_list)
if parameters.check_parameters(sys.argv):
script, xml_source = sys.argv
if xml_source != 'archived' or xml_source != 'new':
xml_source = 'new'
cisis = CISIS(cisis_path)
files_set = BHL_Files_Set(inbox_path, archive_path)
report = Report(report_path + '/_bhl_db.log', report_path + '/_bhl_db.err', report_path + '/_bhl_db.txt')
示例3: Configuration
# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import check_parameters [as 别名]
return filename
if __name__ == '__main__':
from utils.parameters import Parameters
from utils.report import Report
from configuration import Configuration
configuration = Configuration('configuration.ini')
if configuration.check_parameters(['REPORT_PATH', 'INBOX_PATH']):
report_path, xml_path = configuration.return_parameters(['REPORT_PATH', 'INBOX_PATH'])
parameter_list = ['', 'replace item', 'replace title', 'start date = iso date | start | current', 'end date = iso date | current ' ]
parameters = Parameters(parameter_list)
if parameters.check_parameters(sys.argv):
script_name, rep_item, rep_title, start_date, end_date = sys.argv
from datetime import date, timedelta
curr_date = date.today() - timedelta(days=5)
next_date = date.today() + timedelta(days=1)
next_date = next_date.isoformat()