Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7.1, 0.7.2, and 0.7.3

shlib: deal with settings file extension change

fixes #50 properly

Changeset fc3a16d5ddf5

Parent 2a0b937c89e4

by Steve Borho

Changes to one file · Browse files at fc3a16d5ddf5 Showing diff from parent 2a0b937c89e4 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​shlib.py Stacked
 
8
9
10
 
11
12
13
 
86
87
88
89
 
 
 
 
 
 
 
 
 
 
 
 
90
91
92
 
8
9
10
11
12
13
14
 
87
88
89
 
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@@ -8,6 +8,7 @@
 """    import dumbdbm, anydbm +saved_default = anydbm._defaultmod  anydbm._defaultmod = dumbdbm    import os @@ -86,7 +87,18 @@
    def read(self):   self._data.clear() - if not os.path.exists(self._path): + if os.path.exists(self._path): + # One-time import of <=0.7 config file + anydbm._defaultmod = saved_default + dbase = shelve.open(self._path) + self._dbappname = dbase['APPNAME'] + self.version = dbase['VERSION'] + self._data.update(dbase.get('DATA', {})) + dbase.close() + anydbm._defaultmod = dumbdbm + os.unlink(self._path) + return + if not os.path.exists(self._path+'.dat'):   return     dbase = shelve.open(self._path)