本文整理汇总了Python中page.Page.import_tables方法的典型用法代码示例。如果您正苦于以下问题:Python Page.import_tables方法的具体用法?Python Page.import_tables怎么用?Python Page.import_tables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.import_tables方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import import_tables [as 别名]
def update(self):
logging.info("Checking sources for updates")
for id, values in PageImporter.pages.iteritems():
logging.info("Checking page: " + id + " (" + values['country'] + ")")
page = Page(id, values['country'], values['url'])
if page.import_tables() == 0:
logging.info(id + " not modified")
else:
logging.info("Finished importing page: " + id + " (" + values['country'] + ")")
示例2: cl_import
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import import_tables [as 别名]
def cl_import(self, cl_args):
if('all' in cl_args):
logging.info("START IMPORT")
for id, values in PageImporter.pages.iteritems():
logging.info("Importing page: " + id + " (" + values['country'] + ") " + str(datetime.now()))
page = Page(id, values['country'], values['url'])
page.import_tables(True)
logging.info("Finished importing page: " + id + " (" + values['country'] + ")")
logging.info("FINISHED IMPORT")
else:
logging.info("START IMPORT")
for page_id in cl_args:
if page_id not in PageImporter.pages:
if "-" in page_id:
for id, values in PageImporter.pages.iteritems():
if page_id in id:
logging.info("Importing page: " + id + " (" + values['country'] + " - " + values['url'] + ") " + str(datetime.now()))
page = Page(id, values['country'], values['url'])
page.import_tables(True)
logging.info("Finished importing page: " + id + " (" + values['country'] + ")")
else:
logging.warning("Page: " + page_id + " not in pages list")
continue
else:
logging.info("Importing page: " + page_id + " (" + PageImporter.pages[page_id]['country'] + " - " + PageImporter.pages[page_id]['url'] + ")")
page = Page(page_id, PageImporter.pages[page_id]['country'], PageImporter.pages[page_id]['url'])
#print 'yes'
page.import_tables(True)
logging.info("Finished importing page: " + page_id + " (" + PageImporter.pages[page_id]['country'] + ")")
logging.info("FINISHED IMPORT")