本文整理汇总了Python中Settings.Settings.parse_extensions方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.parse_extensions方法的具体用法?Python Settings.parse_extensions怎么用?Python Settings.parse_extensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings.Settings
的用法示例。
在下文中一共展示了Settings.parse_extensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HTML
# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import parse_extensions [as 别名]
# We modify the entire class that sits on the top of the hierarchy, so all new objects will have access to the settings
Top.settings = settings
# Prepare web folder
absolute_tersepic = settings.OutputFolder + '/' + settings.tersepic
if not IO.prepare_folder(absolute_tersepic):
sys.exit()
IO.clean_folder(absolute_tersepic)
# create the web page template
WebPage = HTML()
WebPage.readTemplate()
# Get a list of supported extensions
registered_file_extensions = settings.parse_extensions()
def terse_file(fl,i=None):
log.debug('Opening ' + str(fl))
if fl[0] == 'file':
if not IO.all_readable(fl[1:]):
log.debug('Cannot open ' + str(fl))
return None # to the next file
Parser = ParserFactory.interface_by_file_extension(fl, registered_file_extensions)
else:
Parser = ParserFactory.interface_by_command_line(fl)
# from this moment, f is an object of a specific class according to the file type
Parser.file = fl[1]