Commits

Travis Shirk committed d7b9c02

All files in plugin search paths are imported (i.e. executed) so the examples
needed to be separated.

Comments (0)

Files changed (4)

examples/echo.py

-from __future__ import print_function
-import eyed3
-from eyed3.plugins import Plugin
-from eyed3.utils import guessMimetype
-
-eyed3.require((0, 7))
-
-class EchoPlugin(eyed3.plugins.Plugin):
-    NAMES = ["echo"]
-    SUMMARY = u"Displays each filename and mime-type passed to the plugin"
-
-    def handleFile(self, f):
-        print("%s\t[ %s ]" % (f, guessMimetype(f)))
-

examples/echo2.py

-# -*- coding: utf-8 -*-
-from __future__ import print_function
-import eyed3
-from eyed3.plugins import LoaderPlugin
-
-eyed3.require((0, 7))
-
-class Echo2Plugin(LoaderPlugin):
-    SUMMARY = u"Displays details about audio files"
-    NAMES = ["echo2"]
-
-    def handleFile(self, f):
-        super(Echo2Plugin, self).handleFile(f)
-
-        if not self.audio_file:
-            print("%s: Unsupported type" % f)
-        else:
-            print("Audio info: %s Metadata tag: %s " %
-                  ("yes" if self.audio_file.info else "no",
-                   "yes" if self.audio_file.tag else "no"))

examples/plugins/echo.py

+from __future__ import print_function
+import eyed3
+from eyed3.plugins import Plugin
+from eyed3.utils import guessMimetype
+
+eyed3.require((0, 7))
+
+class EchoPlugin(eyed3.plugins.Plugin):
+    NAMES = ["echo"]
+    SUMMARY = u"Displays each filename and mime-type passed to the plugin"
+
+    def handleFile(self, f):
+        print("%s\t[ %s ]" % (f, guessMimetype(f)))
+

examples/plugins/echo2.py

+# -*- coding: utf-8 -*-
+from __future__ import print_function
+import eyed3
+from eyed3.plugins import LoaderPlugin
+
+eyed3.require((0, 7))
+
+class Echo2Plugin(LoaderPlugin):
+    SUMMARY = u"Displays details about audio files"
+    NAMES = ["echo2"]
+
+    def handleFile(self, f):
+        super(Echo2Plugin, self).handleFile(f)
+
+        if not self.audio_file:
+            print("%s: Unsupported type" % f)
+        else:
+            print("Audio info: %s Metadata tag: %s " %
+                  ("yes" if self.audio_file.info else "no",
+                   "yes" if self.audio_file.tag else "no"))