Revision: 7523
Author:   alexsh
Date:     2009-10-21 04:40:19 +0000 (Wed, 21 Oct 2009)

Log Message:
-----------
add platform modules to detect windows version

Modified Paths:
--------------
    branches/rewrite/pywikibot/config2.py

Modified: branches/rewrite/pywikibot/config2.py
===================================================================
--- branches/rewrite/pywikibot/config2.py       2009-10-21 02:31:09 UTC (rev 
7522)
+++ branches/rewrite/pywikibot/config2.py       2009-10-21 04:40:19 UTC (rev 
7523)
@@ -9,6 +9,7 @@
 
 import os, re
 import sys as __sys
+import platform
 
 # IMPORTANT:
 # Do not change any of the variables in this file. Instead, make
@@ -119,7 +120,11 @@
             is_windows = __sys.platform == 'win32' 
             home = os.path.expanduser("~") 
             if is_windows: 
-                base_dir = os.path.join(home, "Application Data", NAME) 
+                _win_version = int(platform.version()[0])
+                if _win_version == 5:
+                    base_dir = os.path.join(home, "Application Data", NAME) 
+                elif _win_version == 6:
+                    base_dir = os.path.join(home, "AppData\\Roaming", NAME) 
             else: 
                 base_dir = os.path.join(home, "."+NAME) 
             if not os.path.isdir(base_dir): 



_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn

Reply via email to