本文整理汇总了Python中plugin.Plugin.load方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.load方法的具体用法?Python Plugin.load怎么用?Python Plugin.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import load [as 别名]
def __init__ (self):
Plugin.load()
self.allowed_filetypes = []
self.allowed_formats = []
for p, p_class in Plugin.registered.items():
print("Registered output plugin type %s" % p)
self.allowed_filetypes.append(p_class.template_file_extension)
self.allowed_formats.append(p.split('Resume')[0])
示例2: __init__
# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import load [as 别名]
def __init__ (self):
#Plugin.load("plugins/")
script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
Plugin.load(os.path.join(script_dir,"plugins"))
self.allowed_filetypes = []
self.allowed_formats = []
for p, p_class in Plugin.registered.items():
print("Registered output plugin type %s" % p)
self.allowed_filetypes.append(p_class.template_file_extension)
self.allowed_formats.append(p.split('Resume')[0])
示例3: loadPluginsFrom
# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import load [as 别名]
def loadPluginsFrom(self, newPath):
self.selectTechniqueByName(None)
self._techniques = {}
if newPath:
Plugin.load(newPath)
for p in Plugin.getInstances():
origName = p.name.strip()
if not origName:
continue
name = origName
i = 1
while self._techniques.has_key(name):
name = "%s %d" % (origName, i)
i += 1
self._techniques[name] = p
示例4: loadPluginsFrom
# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import load [as 别名]
def loadPluginsFrom(self, newPath):
# force the teardown of the current selected technique (if any)
self.selectTechniqueByName(None)
self._pluginsPath = newPath
self._techniques = {}
if newPath:
Plugin.load(newPath)
for p in Plugin.getInstances():
origName = p.getName()
# some sanity check
origName = unicode(origName).strip() if origName is not None \
else None
if not origName:
continue
# append a discriminant id if the name is already being used
name = origName
i = 1
while name in self._techniques:
name = "%s %d" % (origName, i)
i += 1
self._techniques[name] = p
示例5: _register_plugins
# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import load [as 别名]
def _register_plugins(self):
script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
Plugin.load(os.path.join(script_dir,"plugins"))
for p, p_class in Plugin.registered.items():
print("Registered output plugin type %s" % p)