Compare commits

...

No commits in common. 'c9' and 'i10c-beta' have entirely different histories.

@ -0,0 +1,82 @@
commit 478d595a7d086423733e9f5da5edfe9f1df48682
Author: Troy Curtis Jr <troy@troycurtisjr.com>
Date: Thu Aug 10 21:51:15 2023 -0400
Make asyncore support optional for Python 3.
Fixes #204.
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index bc24313..f4a5a90 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -68,7 +68,6 @@ from collections import deque
from datetime import datetime, timedelta
import time
import re
-import asyncore
import glob
import locale
import subprocess
@@ -1494,33 +1493,40 @@ class ThreadedNotifier(threading.Thread, Notifier):
self.loop()
-class AsyncNotifier(asyncore.file_dispatcher, Notifier):
- """
- This notifier inherits from asyncore.file_dispatcher in order to be able to
- use pyinotify along with the asyncore framework.
+try:
+ import asyncore
- """
- def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
- threshold=0, timeout=None, channel_map=None):
+ class AsyncNotifier(asyncore.file_dispatcher, Notifier):
"""
- Initializes the async notifier. The only additional parameter is
- 'channel_map' which is the optional asyncore private map. See
- Notifier class for the meaning of the others parameters.
+ This notifier inherits from asyncore.file_dispatcher in order to be able to
+ use pyinotify along with the asyncore framework.
"""
- Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
- threshold, timeout)
- asyncore.file_dispatcher.__init__(self, self._fd, channel_map)
+ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
+ threshold=0, timeout=None, channel_map=None):
+ """
+ Initializes the async notifier. The only additional parameter is
+ 'channel_map' which is the optional asyncore private map. See
+ Notifier class for the meaning of the others parameters.
- def handle_read(self):
- """
- When asyncore tells us we can read from the fd, we proceed processing
- events. This method can be overridden for handling a notification
- differently.
+ """
+ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
+ threshold, timeout)
+ asyncore.file_dispatcher.__init__(self, self._fd, channel_map)
- """
- self.read_events()
- self.process_events()
+ def handle_read(self):
+ """
+ When asyncore tells us we can read from the fd, we proceed processing
+ events. This method can be overridden for handling a notification
+ differently.
+
+ """
+ self.read_events()
+ self.process_events()
+except ImportError:
+ # asyncore was removed in Python 3.12, but try the import instead of a
+ # version check in case the compatibility package is installed.
+ pass
class TornadoAsyncNotifier(Notifier):

@ -3,13 +3,17 @@
Summary: Monitor filesystem events with Python under Linux
Name: python-inotify
Version: 0.9.6
Release: 25%{?dist}
Release: 35%{?dist}
License: MIT
URL: https://github.com/seb-m/pyinotify
Source0: http://seb.dbzteam.org/pub/pyinotify/releases/pyinotify-%{version}.tar.gz
Patch01: pyinotify-0.9.6-epoint.patch
# Upstream pull request https://github.com/seb-m/pyinotify/pull/205
# Upstream issue https://github.com/seb-m/pyinotify/issues/204
Patch02: pyinotify-python-3.12-fix.patch
BuildRequires: gmp-devel
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildArch: noarch
%global _description \
This is a Python module for watching filesystems changes. pyinotify \
@ -24,8 +28,7 @@ Summary: %{summary}
%description -n python%{python3_pkgversion}-inotify %_description
%prep
%setup -q -n %{oname}-%{version}
%patch01 -p1
%autosetup -p1 -n %{oname}-%{version}
sed -i '1c#! %{__python3}' python3/pyinotify.py
%build
@ -34,6 +37,9 @@ sed -i '1c#! %{__python3}' python3/pyinotify.py
%install
%py3_install
%check
%py3_check_import pyinotify
%files -n python%{python3_pkgversion}-inotify
%license COPYING
%doc ACKS README.md
@ -42,12 +48,44 @@ sed -i '1c#! %{__python3}' python3/pyinotify.py
%{python3_sitelib}/__pycache__/%{oname}*
%changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.9.6-25
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 0.9.6-35
- Rebuilt for MSVSphere 10
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.9.6-35
- Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Aug 10 2023 Troy Curtis, Jr <troycurtisjr@fedoraproject.org> - 0.9.6-32
- Fixes build for Python 3.12 (#2219556)
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.9.6-30
- Rebuilt for Python 3.12
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.9.6-27
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.9.6-24
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.9.6-24
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.6-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save