[Uludag-commits] r14697 - trunk/staj-projeleri/migration-tool/src

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
4 Tem 2007 Çar 12:07:18 EEST


Author: muratongan
Date: Wed Jul  4 12:07:18 2007
New Revision: 14697

Modified:
   trunk/staj-projeleri/migration-tool/src/Wallpaper.py
Log:
fix for Windows XP :@


Modified: trunk/staj-projeleri/migration-tool/src/Wallpaper.py
=================================================================
--- trunk/staj-projeleri/migration-tool/src/Wallpaper.py	(original)
+++ trunk/staj-projeleri/migration-tool/src/Wallpaper.py	Wed Jul  4 12:07:18 2007
@@ -45,13 +45,24 @@
         return None
 
 def getWindowsWallpaperPath(partition, hive):
-    value = hive.getValue("Control Panel\\Desktop","WallPaper")
-    if value.find("C:\\") != -1:
-        value = value.replace("C:\\", "")
-        value = value.replace("\\", "/")
-        value = winPath(partition, value)
-        if value:
-            return value
+    try:
+        key = hive.getKey("Control Panel\\Desktop")
+        values = key.valueDict()
+        if values.has_key("Wallpaper"):     # Windows XP
+            value = values["Wallpaper"]
+        elif values.has_key("WallPaper"):   # Windows Vista
+            value = values["WallPaper"]
+        else:
+            return ""
+        value = hive.getValue("Control Panel\\Desktop","WallPaper")
+        if value.find("C:\\") != -1:
+            value = value.replace("C:\\", "")
+            value = value.replace("\\", "/")
+            value = winPath(partition, value)
+            if value:
+                return value
+    except:
+        return ""
 
 def getThumbnail(oldfile, width=100, height=100):
     newfile = tempfile.mktemp(".jpg")


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi