X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Fhistoryplacement.py;h=6ce5dff54f8622f2c94307e6accb48729c38e96a;hb=a81b9674752bab92544f7d160734108a0b84007b;hp=d4e7d4652c428b6155e952ecbee181db0a14f940;hpb=220b5c40f91c6509951ccd0d506a9bd77d9d6bac;p=chaz%2Fopenbox diff --git a/scripts/historyplacement.py b/scripts/historyplacement.py index d4e7d465..6ce5dff5 100644 --- a/scripts/historyplacement.py +++ b/scripts/historyplacement.py @@ -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