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
1=== modified file 'controller.py'
2--- controller.py 2009-09-19 07:36:09 +0000
3+++ controller.py 2009-10-03 21:15:21 +0000
4@@ -166,6 +166,11 @@
5 Traceback (most recent call last):
6 ...
7 InvalidTransactionException: Transaction does not exist in account 'My Renamed Account'
8+
9+# cleanUp
10+>>> controller.Close()
11+>>> Publisher.unsubAll()
12+>>> os.remove("test.db")
13 """
14
15 from persistentstore import PersistentStore
16@@ -218,7 +223,7 @@
17 self.MigrateIfFound(oldBankPath, fileservice.getDataFilePath(self.DB_NAME))
18
19 # Okay, now our files are in happy locations, let's go!
20- config = wx.Config(localFilename=configPath)
21+ config = wx.FileConfig(localFilename=configPath)
22 wx.Config.Set(config)
23 if not config.HasEntry("SIZE_X"):
24 config.WriteInt("SIZE_X", 800)
25@@ -271,7 +276,7 @@
26 return model
27
28 def Close(self, model=None):
29- if model is None: models = self.Models
30+ if model is None: models = self.Models[:]
31 else: models = [model]
32
33 for model in models:
34
35=== modified file 'fileservice.py'
36--- fileservice.py 2009-09-18 07:27:13 +0000
37+++ fileservice.py 2009-10-03 21:15:21 +0000
38@@ -38,7 +38,11 @@
39 pathdir = os.path.join(os.environ["HOME"], ".wxbanker")
40 elif "APPDATA" in os.environ:
41 # Windows!
42- pathdir = os.path.join(os.environ["APPDATA"], "wxbanker")
43+ appdata = os.environ["APPDATA"]
44+ if type(appdata) != unicode:
45+ import locale
46+ appdata = unicode(appdata, locale.getlocale()[1])
47+ pathdir = os.path.join(appdata, "wxbanker")
48 else:
49 raise Exception("Unable to find a home for user data!")
50

Subscribers

People subscribed via source and target branches

to all changes: