Scripting way to upload videos to peertube and youtube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

48 lines
1.8 KiB

import pluginInterfaces as pi
from yapsy.PluginManager import PluginManagerSingleton
class Help(pi.IInterfacePlugin):
"""
The help plugin print the usage informations of prismedia’s plugins.
Use it by simply caling `prismedia help <plugin_name>`.
For example `prismedia help help` bring this help.
"""
def prepareOptions(self, video, options):
pluginManager = PluginManagerSingleton.get()
if options["<parameters>"]:
parameters = options["<parameters>"]
else:
parameters = ["help"]
for p in parameters:
plugin = pluginManager.getPluginByName(p, pi.PluginTypes.ALL)
if plugin is None:
# TODO: log instead to warning ? error ?
print("No plugin was found with name:", p)
continue
print(plugin.name + "\t" + plugin.description)
print("Usage:", plugin.plugin_object.__doc__)
if p == "help":
print("The plugins are stored in the following folders:", pluginManager.getPluginLocator().plugins_places)
print("Category:", pi.PluginTypes.INTERFACE.value)
for plugin in pluginManager.getPluginsOfCategory(pi.PluginTypes.INTERFACE):
print("\t" + plugin.name)
print("Category:", pi.PluginTypes.PLATFORM.value)
for plugin in pluginManager.getPluginsOfCategory(pi.PluginTypes.PLATFORM):
print("\t" + plugin.name)
print("Category:", pi.PluginTypes.CONSUMER.value)
for plugin in pluginManager.getPluginsOfCategory(pi.PluginTypes.CONSUMER):
print("\t" + plugin.name)
# Print a line breack between each plugin help.
print()
return False