本文整理汇总了Python中gears.environment.Environment.register_entry_points方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.register_entry_points方法的具体用法?Python Environment.register_entry_points怎么用?Python Environment.register_entry_points使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gears.environment.Environment
的用法示例。
在下文中一共展示了Environment.register_entry_points方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: isinstance
# 需要导入模块: from gears.environment import Environment [as 别名]
# 或者: from gears.environment.Environment import register_entry_points [as 别名]
if isinstance(path, (list, tuple)):
path, options = path
else:
options = None
cache = get_cache(path, options)
environment = Environment(
root=GEARS_ROOT,
public_assets=getattr(settings, 'GEARS_PUBLIC_ASSETS', DEFAULT_PUBLIC_ASSETS),
cache=cache,
gzip=getattr(settings, 'GEARS_GZIP', False),
fingerprinting=getattr(settings, 'GEARS_FINGERPRINTING', True),
)
if getattr(settings, 'GEARS_REGISTER_ENTRY_POINTS', False):
environment.register_entry_points()
for path in getattr(settings, 'GEARS_FINDERS', DEFAULT_FINDERS):
if isinstance(path, (list, tuple)):
path, options = path
else:
options = None
environment.finders.register(get_finder(path, options))
mimetypes = getattr(settings, 'GEARS_MIMETYPES', DEFAULT_MIMETYPES)
for extension, mimetype in mimetypes.items():
environment.mimetypes.register(extension, mimetype)
for extension, path in getattr(settings, 'GEARS_COMPILERS', {}).items():
if isinstance(path, (list, tuple)):
path, options = path