[mousetrap-list] Issue starting without ~/.mouseTrap



Hello,

mousetrap at last got accepted in Debian, and there's already a bug
report :)

When a user doesn't have a ~/.mouseTrap/ directory, early debugging
coming from loading the mouse module makes mouseTrap crash.  Also, if
the directory exists but there is no configuration file, mouseTrap
crashes.

The attached patch should fix both issues.

Samuel
--- gnome-mousetrap-0.3+svn17.orig/src/mouseTrap/mouseTrap.py
+++ gnome-mousetrap-0.3+svn17/src/mouseTrap/mouseTrap.py
@@ -41,6 +41,9 @@
 
 import environment as env
 
+if not os.path.exists( env.configPath ):
+    os.mkdir( env.configPath )
+
 from mTi18n import _
 
 try:
@@ -235,8 +238,7 @@
     
     if not settings:
         try:
-            if not os.path.exists( env.configPath ):
-                os.mkdir( env.configPath )
+            if not os.path.exists( env.configFile ):
                 mTPref.writeFirstConf()
             
             if not os.path.exists( env.scriptsPath ):


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