[packages/python-eyeD3] - added pyc patch (fix plugins loading without .py files); release 3

qboosh qboosh at pld-linux.org
Sun Feb 24 21:10:31 CET 2019


commit 78ce46539a6ed4da53653e0faade2a705435fa2b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 24 21:16:03 2019 +0100

    - added pyc patch (fix plugins loading without .py files); release 3

 python-eyeD3-pyc.patch | 33 +++++++++++++++++++++++++++++++++
 python-eyeD3.spec      |  4 +++-
 2 files changed, 36 insertions(+), 1 deletion(-)
---
diff --git a/python-eyeD3.spec b/python-eyeD3.spec
index 1cfbe9c..f33810c 100644
--- a/python-eyeD3.spec
+++ b/python-eyeD3.spec
@@ -12,11 +12,12 @@ Summary:	Python 2 module for manipulating ID3 informational tags on MP3 audio fi
 Summary(pl.UTF-8):	Moduł Pythona 2 służący do operacji na znacznikach ID3 plików MP3
 Name:		python-%{module}
 Version:	0.8
-Release:	2
+Release:	3
 License:	GPL v3
 Group:		Development/Languages/Python
 Source0:	http://eyed3.nicfit.net/releases/%{module}-%{version}.tar.gz
 # Source0-md5:	840626686e6b1bc6afca9eab99a0873a
+Patch0:		%{name}-pyc.patch
 URL:		http://eyed3.nicfit.net/
 %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
 BuildRequires:	glibc-localedb-all
@@ -101,6 +102,7 @@ Dokumentacja API modułu Pythona eyeD3.
 
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
 
 %build
 export LC_ALL=C.UTF-8
diff --git a/python-eyeD3-pyc.patch b/python-eyeD3-pyc.patch
new file mode 100644
index 0000000..d5a00eb
--- /dev/null
+++ b/python-eyeD3-pyc.patch
@@ -0,0 +1,33 @@
+--- eyeD3-0.8/src/eyed3/plugins/__init__.py.orig	2017-03-12 23:18:52.000000000 +0100
++++ eyeD3-0.8/src/eyed3/plugins/__init__.py	2019-02-24 18:04:20.190456261 +0100
+@@ -50,11 +50,10 @@
+ 
+     def _isValidModule(f, d):
+         '''Determine if file ``f`` is a valid module file name.'''
+-        # 1) tis a file
++        # 1) is a file
+         # 2) does not start with '_', or '.'
+-        # 3) avoid the .pyc dup
+         return bool(os.path.isfile(os.path.join(d, f)) and
+-                    f[0] not in ('_', '.') and f.endswith(".py"))
++                    f[0] not in ('_', '.') and (f.endswith(".py") or f.endswith(".pyc")))
+ 
+     log.debug("Extra plugin paths: %s" % paths)
+     for d in [os.path.dirname(__file__)] + (paths if paths else []):
+@@ -65,11 +64,16 @@
+         if d not in sys.path:
+             sys.path.append(d)
+         try:
++            loaded = set()
+             for f in os.listdir(d):
+                 if not _isValidModule(f, d):
+                     continue
+ 
+                 mod_name = os.path.splitext(f)[0]
++                if mod_name in loaded:
++                    continue
++                loaded.add(mod_name)
++
+                 try:
+                     mod = __import__(mod_name, globals=globals(),
+                                      locals=locals())
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-eyeD3.git/commitdiff/78ce46539a6ed4da53653e0faade2a705435fa2b



More information about the pld-cvs-commit mailing list