Put state in a directory of its own.
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 20 Aug 2004 05:57:23 +0000 (05:57 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 20 Aug 2004 05:57:23 +0000 (05:57 +0000)
src/gkofoto/gkofoto/persistentstate.py

index e5c4db3..1217b91 100644 (file)
@@ -14,10 +14,12 @@ class PersistentState(object):
         home = os.path.expanduser("~")
         if sys.platform.startswith("win"):
             self.__stateFile = os.path.join(
-                home, "KofotoData", "gkofoto-state.ini")
+                home, "KofotoData", "state", "gkofoto.ini")
         else:
             self.__stateFile = os.path.join(
-                home, ".kofoto", "gkofoto-state")
+                home, ".kofoto", "state", "gkofoto")
+        if not os.path.isdir(os.path.dirname(self.__stateFile)):
+            os.mkdir(os.path.dirname(self.__stateFile))
         if os.path.isfile(self.__stateFile):
             self.__configParser.read(self.__stateFile)