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.

51 lines
1.9 KiB

  1. import pluginInterfaces as pi
  2. from yapsy.PluginManager import PluginManagerSingleton
  3. class Help(pi.IInterfacePlugin):
  4. """
  5. The help plugin print the usage information of prismedias plugins.
  6. Use it by simply calling `prismedia help <plugin_name>...`.
  7. For example `prismedia help help` bring this help.
  8. """
  9. def prepare_options(self, video, options):
  10. print(__name__)
  11. pluginManager = PluginManagerSingleton.get()
  12. if options["<parameters>"]:
  13. parameters = options["<parameters>"]
  14. else:
  15. parameters = ["help"]
  16. for p in parameters:
  17. plugin = pluginManager.getPluginByName(p, pi.PluginTypes.ALL)
  18. if plugin is None:
  19. # TODO: log instead to warning? error?
  20. print("No plugin was found with name:", p)
  21. continue
  22. print(plugin.name + "\t" + plugin.description)
  23. print("Usage:", plugin.plugin_object.__doc__)
  24. # Generic help this plugin is able to give for the
  25. if p == "help":
  26. print("The plugins are stored in the following folders:", pluginManager.getPluginLocator().plugins_places)
  27. print("Category:", pi.PluginTypes.INTERFACE.value)
  28. for plugin in pluginManager.getPluginsOfCategory(pi.PluginTypes.INTERFACE):
  29. print("\t" + plugin.name)
  30. print("Category:", pi.PluginTypes.PLATFORM.value)
  31. for plugin in pluginManager.getPluginsOfCategory(pi.PluginTypes.PLATFORM):
  32. print("\t" + plugin.name)
  33. print("Category:", pi.PluginTypes.CONSUMER.value)
  34. for plugin in pluginManager.getPluginsOfCategory(pi.PluginTypes.CONSUMER):
  35. print("\t" + plugin.name)
  36. # Print a line break between each plugin help.
  37. print()
  38. return False