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

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