diff --git a/prismedia/plugins/consumers/debug.py b/prismedia/plugins/consumers/debug.py new file mode 100644 index 0000000..0991f6c --- /dev/null +++ b/prismedia/plugins/consumers/debug.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# coding: utf-8 + +import pluginInterfaces as pi +import utils +import video as vid + +class Debug(pi.IConsumerPlugin): + """ + Plugin to help knowing the state of prismedia and its variables. + """ + + def prepare_options(self, video, options): + print("Debug plugin prepare_options:") + print("Video: ", video) + print("Options: ", options) + + return True + + def finished(self, video, options): + print("Debug plugin finished:") + print("Video: ", video) + print("Options: ", options) diff --git a/prismedia/plugins/consumers/debug.yapsy-plugin b/prismedia/plugins/consumers/debug.yapsy-plugin new file mode 100644 index 0000000..bad7651 --- /dev/null +++ b/prismedia/plugins/consumers/debug.yapsy-plugin @@ -0,0 +1,9 @@ +[Core] +Name = debug +Module = debug + +[Documentation] +Author = Zykino +Version = 0.1 +Website = https://git.lecygnenoir.info/LecygneNoir/prismedia +Description = Show status of elements diff --git a/prismedia/video.py b/prismedia/video.py index 71a9d60..ce26917 100644 --- a/prismedia/video.py +++ b/prismedia/video.py @@ -10,6 +10,9 @@ class Platform(object): self.publishAt = None self.url = None + def __repr__(self): + return str(self.__dict__) + # TODO: Add container for `with-*` and a `isValid` method to check that all `with-*` options are present # TODO: We need some list (using enum?) for the commons licences, language, privacy, categories options class Video(object): @@ -109,3 +112,10 @@ class Video(object): @name.setter def name(self, value): self._name = value + + def __repr__(self): + result = "{\n" + for key in self.__dict__: + result += "\t'" + key + "': " + str(self.__dict__[key]) + ",\n" + result += "}\n" + return result