diff --git a/.pylintrc b/.pylintrc index ceed83c4b2..1b97f99e6f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -4,7 +4,6 @@ # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code extension-pkg-whitelist=gi, - pyinotify, setproctitle # Add files or directories to the blacklist. They should be base names, not diff --git a/debian/control b/debian/control index 5724014190..1b3991f221 100644 --- a/debian/control +++ b/debian/control @@ -99,7 +99,6 @@ Depends: python3-pam | python3-pampy, python3-pexpect, python3-pil, - python3-pyinotify, python3-requests, python3-setproctitle, python3-tinycss2, diff --git a/files/usr/share/cinnamon/cinnamon-looking-glass/cinnamon-looking-glass.py b/files/usr/share/cinnamon/cinnamon-looking-glass/cinnamon-looking-glass.py index d4fb217f65..b59f98fbfe 100755 --- a/files/usr/share/cinnamon/cinnamon-looking-glass/cinnamon-looking-glass.py +++ b/files/usr/share/cinnamon/cinnamon-looking-glass/cinnamon-looking-glass.py @@ -15,7 +15,6 @@ import os import signal import sys -import pyinotify import gi gi.require_version('Gtk', '3.0') from gi.repository import Gio, Gtk, GObject, Gdk, GLib @@ -224,22 +223,6 @@ def select_file(self): return result -class FileWatchHandler(pyinotify.ProcessEvent): - def my_init(self, view): - self.view = view - - def process_IN_CLOSE_WRITE(self, event): - self.view.get_updates() - - def process_IN_CREATE(self, event): - self.view.get_updates() - - def process_IN_DELETE(self, event): - self.view.get_updates() - - def process_IN_MODIFY(self, event): - self.view.get_updates() - class FileWatcherView(Gtk.ScrolledWindow): def __init__(self, filename): Gtk.ScrolledWindow.__init__(self) @@ -259,21 +242,18 @@ def __init__(self, filename): self.show_all() self.get_updates() - handler = FileWatchHandler(view=self) - watch_manager = pyinotify.WatchManager() - self.notifier = pyinotify.ThreadedNotifier(watch_manager, handler) - watch_manager.add_watch(filename, (pyinotify.IN_CLOSE_WRITE | - pyinotify.IN_CREATE | - pyinotify.IN_DELETE | - pyinotify.IN_MODIFY)) - self.notifier.start() + self.monitor = Gio.File.new_for_path(filename).monitor_file(Gio.FileMonitorFlags.NONE, None) + self.monitor.connect("changed", self.on_file_changed) self.connect("destroy", self.on_destroy) self.connect("size-allocate", self.on_size_changed) + def on_file_changed(self, monitor, gfile, other_file, event_type): + self.get_updates() + def on_destroy(self, widget): - if self.notifier: - self.notifier.stop() - self.notifier = None + if self.monitor: + self.monitor.cancel() + self.monitor = None def on_size_changed(self, widget, bla): if self.changed > 0: