]> git.pld-linux.org Git - packages/python-eyeD3.git/commitdiff
- added pyc patch (fix plugins loading without .py files); release 3 auto/th/python-eyeD3-0.8-3
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 24 Feb 2019 20:16:03 +0000 (21:16 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 24 Feb 2019 20:16:03 +0000 (21:16 +0100)
python-eyeD3-pyc.patch [new file with mode: 0644]
python-eyeD3.spec

diff --git a/python-eyeD3-pyc.patch b/python-eyeD3-pyc.patch
new file mode 100644 (file)
index 0000000..d5a00eb
--- /dev/null
@@ -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())
index 1cfbe9cca4bb523b63a9e82c94bacbc3eba5f542..f33810c6640a683aa3c34ed44299d50a20a1ad2d 100644 (file)
@@ -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
This page took 0.144143 seconds and 4 git commands to generate.