]> Dogcows Code - chaz/openbox/blobdiff - scripts/historyplacement.py
grab early in the cycle so that we dont miss the modifier release
[chaz/openbox] / scripts / historyplacement.py
index d4e7d4652c428b6155e952ecbee181db0a14f940..6ce5dff54f8622f2c94307e6accb48729c38e96a 100644 (file)
@@ -60,9 +60,9 @@ class _state:
 
 def _load(data):
     global _data
-    file = open(os.environ['HOME']+'/.openbox/'+FILENAME+"."+str(data.screen),
-                'r')
-    if file:
+    try:
+        file = open(os.environ['HOME'] + '/.openbox/' + FILENAME+"." +
+                    str(data.screen), 'r')
         # read data
         for line in file.readlines():
             line = line[:-1] # drop the '\n'
@@ -75,11 +75,10 @@ def _load(data):
                     _data.append([])
                 _data[data.screen].append(state)
                 
-            except ValueError:
-                pass
-            except IndexError:
-                pass
+            except ValueError: pass
+            except IndexError: pass
         file.close()
+    except IOError: pass
 
 def _save(data):
     global _data
This page took 0.022015 seconds and 4 git commands to generate.