Merge lp:~kolmis/wxbanker/windows-fixes into lp:wxbanker

Proposed by Karel Kolman
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kolmis/wxbanker/windows-fixes
Merge into: lp:wxbanker
Diff against target: 49 lines
2 files modified
controller.py (+7/-2)
fileservice.py (+5/-1)
To merge this branch: bzr merge lp:~kolmis/wxbanker/windows-fixes
Reviewer Review Type Date Requested Status
Michael Rooney Approve
Review via email: mp+12831@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Karel Kolman (kolmis) wrote :

A few bugfixes for Windows systems.

Revision history for this message
Michael Rooney (mrooney) wrote :

Thanks for fixing that %APPDATA% issue that I wasn't aware of, as well as using a FileConfig, that is probably a little cleaner. Also thanks for fixing 23 of the unit tests that were having IO problems :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'controller.py'
--- controller.py 2009-09-19 07:36:09 +0000
+++ controller.py 2009-10-03 21:15:21 +0000
@@ -166,6 +166,11 @@
166Traceback (most recent call last):166Traceback (most recent call last):
167 ...167 ...
168InvalidTransactionException: Transaction does not exist in account 'My Renamed Account'168InvalidTransactionException: Transaction does not exist in account 'My Renamed Account'
169
170# cleanUp
171>>> controller.Close()
172>>> Publisher.unsubAll()
173>>> os.remove("test.db")
169"""174"""
170175
171from persistentstore import PersistentStore176from persistentstore import PersistentStore
@@ -218,7 +223,7 @@
218 self.MigrateIfFound(oldBankPath, fileservice.getDataFilePath(self.DB_NAME))223 self.MigrateIfFound(oldBankPath, fileservice.getDataFilePath(self.DB_NAME))
219 224
220 # Okay, now our files are in happy locations, let's go!225 # Okay, now our files are in happy locations, let's go!
221 config = wx.Config(localFilename=configPath)226 config = wx.FileConfig(localFilename=configPath)
222 wx.Config.Set(config)227 wx.Config.Set(config)
223 if not config.HasEntry("SIZE_X"):228 if not config.HasEntry("SIZE_X"):
224 config.WriteInt("SIZE_X", 800)229 config.WriteInt("SIZE_X", 800)
@@ -271,7 +276,7 @@
271 return model276 return model
272277
273 def Close(self, model=None):278 def Close(self, model=None):
274 if model is None: models = self.Models279 if model is None: models = self.Models[:]
275 else: models = [model]280 else: models = [model]
276281
277 for model in models:282 for model in models:
278283
=== modified file 'fileservice.py'
--- fileservice.py 2009-09-18 07:27:13 +0000
+++ fileservice.py 2009-10-03 21:15:21 +0000
@@ -38,7 +38,11 @@
38 pathdir = os.path.join(os.environ["HOME"], ".wxbanker")38 pathdir = os.path.join(os.environ["HOME"], ".wxbanker")
39 elif "APPDATA" in os.environ:39 elif "APPDATA" in os.environ:
40 # Windows!40 # Windows!
41 pathdir = os.path.join(os.environ["APPDATA"], "wxbanker")41 appdata = os.environ["APPDATA"]
42 if type(appdata) != unicode:
43 import locale
44 appdata = unicode(appdata, locale.getlocale()[1])
45 pathdir = os.path.join(appdata, "wxbanker")
42 else:46 else:
43 raise Exception("Unable to find a home for user data!")47 raise Exception("Unable to find a home for user data!")
44 48

Subscribers

People subscribed via source and target branches

to all changes: