OSDN Git Service

config: always create subdirectories
authorMartin Renold <martinxyz@gmx.ch>
Tue, 15 Mar 2011 21:32:39 +0000 (22:32 +0100)
committerMartin Renold <martinxyz@gmx.ch>
Tue, 15 Mar 2011 21:33:41 +0000 (22:33 +0100)
So the user knows where to drop backgrounds.

gui/application.py

index f38e8a8..226c704 100644 (file)
@@ -24,9 +24,12 @@ class Application: # singleton
         self.confpath = confpath
         self.datapath = datapath
 
-        if not os.path.isdir(self.confpath):
-            os.mkdir(self.confpath)
-            print 'Created', self.confpath
+        # create config directory, and subdirs where the user might drop files
+        for d in ['', 'backgrounds', 'brushes']:
+            d = os.path.join(self.confpath, d)
+            if not os.path.isdir(d):
+                os.mkdir(d)
+                print 'Created', d
 
         self.ui_manager = gtk.UIManager()