当前位置: 首页>>代码示例>>Python>>正文


Python Configuration.check_parameters方法代码示例

本文整理汇总了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)
开发者ID:robertatakenaka,项目名称:Biodiversidade,代码行数:33,代码来源:bhl_db.py

示例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')
开发者ID:robertatakenaka,项目名称:Biodiversidade,代码行数:32,代码来源:bhl_db.py

示例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()
开发者ID:robertatakenaka,项目名称:Biodiversidade,代码行数:32,代码来源:bhl_download.py


注:本文中的configuration.Configuration.check_parameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。