[meld] Remove dialog use from CVS in favour of logging



commit c4061dae84192c7ad34b62c0e80984224e989bd3
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Aug 17 13:01:48 2013 +1000

    Remove dialog use from CVS in favour of logging
    
    These were low-level errors that indicated broken things in the CVS
    repository, not general problems in Meld. There's little point in
    displaying such errors to the user, so logging is more appropriate.

 meld/vc/cvs.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/meld/vc/cvs.py b/meld/vc/cvs.py
index 51f99e9..ca8f8e2 100644
--- a/meld/vc/cvs.py
+++ b/meld/vc/cvs.py
@@ -24,7 +24,6 @@
 
 import logging
 import os
-from gettext import gettext as _
 import re
 import shutil
 import tempfile
@@ -33,6 +32,8 @@ import time
 from meld import misc
 from . import _vc
 
+log = logging.getLogger(__name__)
+
 
 class FakeErrorStream(object):
     def error(self, error):
@@ -124,8 +125,6 @@ class Vc(_vc.Vc):
                 os.rmdir(tmpdir)
 
     def _get_dirsandfiles(self, directory, dirs, files):
-        log = logging.getLogger(__name__)
-
         vc_path = os.path.join(directory, self.VC_DIR)
 
         try:
@@ -227,10 +226,10 @@ class Vc(_vc.Vc):
             try:
                 regexes = [misc.shell_to_regex(i)[:-1] for i in ignored]
                 ignore_re = re.compile("(" + "|".join(regexes) + ")")
-            except re.error as e:
-                misc.run_dialog(_("Error converting to a regular expression\n"
-                                  "The pattern was '%s'\nThe error was '%s'") %
-                                (",".join(ignored), e))
+            except re.error as err:
+                log.warning(
+                    "Error converting %s to a regular expression: %s'" %
+                    (",".join(ignored), err))
         else:
             class dummy(object):
                 def match(self, *args):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]