From b543bf36144a144847762c89208a9a2588762d0d Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 13 Jan 2008 04:16:37 -0800 Subject: [PATCH] Log the failure to import inotify instead of notifying the user with a messagebox Previously, if python-pyinotify was not installed we would we present the user with a messagebox informing them of this fact everytime the app is launched. This changes it so that the nag message is only printed to log only. Signed-off by: David Aguilar --- ugitlibs/controllers.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ugitlibs/controllers.py b/ugitlibs/controllers.py index 244495c..62ce623 100644 --- a/ugitlibs/controllers.py +++ b/ugitlibs/controllers.py @@ -601,20 +601,26 @@ class Controller(QObserver): self.inotify_thread = None try: from inotify import GitNotifier + qtutils.log('inotify support: enabled') except ImportError: import platform if platform.system() == 'Linux': - msg = self.tr('Unable import pyinotify.\n' - + 'inotify support is disabled.\n\n') - plat = platform.platform().lower() + + msg = self.tr( + 'inotify: disabled\n' + 'Note: To enable inotify, ' + 'install python-pyinotify.\n') + + plat = platform.platform() if 'debian' in plat or 'ubuntu' in plat: - msg += (self.tr('Hint:') - + 'sudo apt-get install' - + ' python-pyinotify') + msg += self.tr( + 'On Debian or Ubuntu systems, ' + 'try: sudo apt-get install ' + 'python-pyinotify') + qtutils.log(msg) - qtutils.information(self.view, - self.tr('inotify disabled'), msg) return + # Start the notification thread self.inotify_thread = GitNotifier(self, os.getcwd()) self.inotify_thread.start() -- 2.11.4.GIT