diff --git a/gitso/trunk/ArgsParser.py b/gitso/trunk/ArgsParser.py index b56047a..78b0bb5 100644 --- a/gitso/trunk/ArgsParser.py +++ b/gitso/trunk/ArgsParser.py @@ -130,7 +130,7 @@ class ArgsParser: os.makedirs(self.paths['preferences'], 0700) self.paths['preferences'] = os.path.join(self.paths['preferences'], "hosts") elif sys.platform == "win32": - self.paths['preferences'] = os.path.join(os.getenv('APPDATA'), "gitso-hosts") + self.paths['preferences'] = os.path.join(os.getenv('USERPROFILE'), "gitso-hosts") else: self.paths['preferences'] = os.path.join(os.path.expanduser("~"), ".gitso-hosts") diff --git a/gitso/trunk/ConnectionWindow.py b/gitso/trunk/ConnectionWindow.py index 7d16af8..ae703ec 100644 --- a/gitso/trunk/ConnectionWindow.py +++ b/gitso/trunk/ConnectionWindow.py @@ -309,9 +309,10 @@ class ConnectionWindow(wx.Frame): def saveHost(self, file, host): - handle = open(file, 'a') - handle.write(", %s" % host) - handle.close() + if os.path.exists(file): + handle = open(file, 'a') + handle.write(", %s" % host) + handle.close() def displayHostBox(self, list, text): self.hostField = wx.ComboBox(self, 30, "", wx.Point(105, 12), wx.Size(230, -1), list, wx.CB_DROPDOWN)