summaryrefslogtreecommitdiffstats
path: root/wineconfig
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-01-28 21:28:52 +0900
committerMichele Calgaro <[email protected]>2023-01-29 00:00:40 +0900
commitcf571297f52ad4a5e5843555d9c016d526f03c43 (patch)
tree7e9eb123a08b935d382ac194a9a1f9e666ee09ee /wineconfig
parent00acd92ff96bd6d3bb3136aa6d6b37314b3ad623 (diff)
downloadtde-guidance-cf571297f52ad4a5e5843555d9c016d526f03c43.tar.gz
tde-guidance-cf571297f52ad4a5e5843555d9c016d526f03c43.zip
Fix functionality with python 3.r14.1.0
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'wineconfig')
-rwxr-xr-xwineconfig/wineconfig.py6
-rw-r--r--wineconfig/wineread.py22
-rw-r--r--wineconfig/winewrite.py10
3 files changed, 20 insertions, 18 deletions
diff --git a/wineconfig/wineconfig.py b/wineconfig/wineconfig.py
index f5ab322..628f57d 100755
--- a/wineconfig/wineconfig.py
+++ b/wineconfig/wineconfig.py
@@ -430,8 +430,8 @@ class WineConfigApp(programbase):
if standalone:
self.enableButton(KDialogBase.User1,changed) # Reset button
self.enableButtonApply(changed) # Apply button
- else:
- self.emit(SIGNAL("changed(bool)"), (changed,) )
+ #else:
+ # self.emit(SIGNAL("changed(bool)"), (changed,) )
############################################################################
''' Not used.
@@ -1806,7 +1806,7 @@ class AppearancePage(TQWidget):
spacer = TQWidget(self.customcolorsvbox)
self.customcolorsvbox.setStretchFactor(spacer,1)
- self.customcolorsvbox.setMinimumHeight(itemtext.height()*4.5)
+ self.customcolorsvbox.setMinimumHeight(int(itemtext.height()*4.5))
#self.customcolorsvbox.setStretchFactor(self.customcolorsgrid,1)
bottomspacer = TQSpacerItem(51,160,TQSizePolicy.Minimum,TQSizePolicy.Expanding)
diff --git a/wineconfig/wineread.py b/wineconfig/wineread.py
index d334d7c..3a051d8 100644
--- a/wineconfig/wineread.py
+++ b/wineconfig/wineread.py
@@ -23,7 +23,7 @@ import os
# Assumes the fake windows is installed in ~/.wine
default_winepath = os.environ['HOME'] + "/.wine"
winepath = default_winepath
-defaultwinfolderspath = "c:\\windows\\profiles\\" + os.environ['USER']
+defaultwinfolderspath = "c:\\users\\" + os.environ['USER']
# Where the dll's are
default_winebuildpath = "/usr/lib/wine"
@@ -113,7 +113,7 @@ empty_shelllinks = ([26,"Desktop","","","",""],
[30,"My Video","","","",""])
folder_nonexistent = "This folder does not exist, please map it."
-profilesdirectory = winepath + "/dosdevices/c:/windows/profiles/" + os.environ['USER']
+profilesdirectory = winepath + "/dosdevices/c:/users/" + os.environ['USER']
def GetEmptyShellLinks():
""" Returns a list of important windows folders """
@@ -159,7 +159,7 @@ def GetValue(key, value):
if error != 0:
return ""
- file=open('.registryvalue.reg')
+ file=open('.registryvalue.reg', encoding='utf-16', mode='r')
for line in file:
if line and line[0] == '"' or line[0] == '@':
@@ -188,7 +188,7 @@ def GetKeyValues(key):
settings = {}
- file=open('.registrykey.reg')
+ file=open('.registrykey.reg', encoding='utf-16', mode='r')
keycount = 0
for line in file:
@@ -210,7 +210,7 @@ def GetUserShellRegistry():
if error != 0:
return {}
- usershellfile=open('.registryshelluser.reg')
+ usershellfile=open('.registryshelluser.reg', encoding='utf-16', mode='r')
usershellfilelines = usershellfile.readlines()
usershellfile.close()
os.remove(".registryshelluser.reg")
@@ -221,7 +221,8 @@ def GetUserShellRegistry():
for usershellline in usershellfilelines:
usershellline = usershellline.split('=')
- settings[usershellline[0].strip('"')] = usershellline[1].strip('"\r\n')
+ if len(usershellline) == 2:
+ settings[usershellline[0].strip('"')] = usershellline[1].strip('"\r\n')
return settings
@@ -230,7 +231,7 @@ def GetShellRegistry():
if error != 0:
return {}
- shellfile=open('.registryshell.reg')
+ shellfile=open('.registryshell.reg', encoding='utf-16', mode='r')
shellfilelines = shellfile.readlines()
shellfile.close()
os.remove(".registryshell.reg")
@@ -241,7 +242,8 @@ def GetShellRegistry():
for shellline in shellfilelines:
shellline = shellline.split('=')
- settings[shellline[0].strip('"')] = shellline[1].strip('"\r\n')
+ if len(shellline) == 2:
+ settings[shellline[0].strip('"')] = shellline[1].strip('"\r\n')
return settings
@@ -314,7 +316,7 @@ def GetApps():
if error != 0:
return []
- settingsfile=open('.registryapps.reg')
+ settingsfile=open('.registryapps.reg', encoding='utf-16', mode='r')
settingsfilelines = settingsfile.readlines()
settingsfile.close()
os.remove('.registryapps.reg')
@@ -537,7 +539,7 @@ def VerifyWineDrive(path = None):
if not path:
path = self.default_winepath
- return os.path.exists(path + "/dosdevices/c:/windows/profiles/" + os.environ['USER']) and \
+ return os.path.exists(path + "/dosdevices/c:/users/" + os.environ['USER']) and \
os.path.exists(path + "/dosdevices/c:/windows/system32") and \
os.path.exists(path + "/system.reg") and os.path.exists(path + "/userdef.reg") and \
os.path.exists(path + "/user.reg")
diff --git a/wineconfig/winewrite.py b/wineconfig/winewrite.py
index b208e66..39f1ce3 100644
--- a/wineconfig/winewrite.py
+++ b/wineconfig/winewrite.py
@@ -60,14 +60,14 @@ def SetDriveMappings(drives):
SetShellLinks(drives[26:])
def SetShellLinks(shelllinks):
- existingshelllinks = os.listdir(wineread.winepath + "/dosdevices/c:/windows/profiles/" + os.environ['USER'])
+ existingshelllinks = os.listdir(wineread.winepath + "/dosdevices/c:/users/" + os.environ['USER'])
set(existingshelllinks)
shellregistry = wineread.GetShellRegistry()
for link in shelllinks:
createLink = False
if link[1] in existingshelllinks: # The link exists
- linkpath = wineread.winepath + "/dosdevices/c:/windows/profiles/" + os.environ['USER'] + "/" + link[1]
+ linkpath = wineread.winepath + "/dosdevices/c:/users/" + os.environ['USER'] + "/" + link[1]
if link[2]: # The folder is mapped
# Compare for changes
changed = False
@@ -98,7 +98,7 @@ def SetShellLinks(shelllinks):
continue
if createLink:
- os.symlink(link[2], wineread.winepath + "/dosdevices/c:/windows/profiles/" + os.environ['USER'] + "/" + link[1])
+ os.symlink(link[2], wineread.winepath + "/dosdevices/c:/users/" + os.environ['USER'] + "/" + link[1])
if link[1] in shellregistry:
SetShellRegistry(link)
@@ -426,7 +426,7 @@ def CreateWineDrive(path = None):
if not path:
path = wineread.default_winepath
- os.system("WINEPREFIX=" + path + " wineprefixcreate --wait")
+ os.system("WINEPREFIX=" + path + " winepath --wait")
# ----- Theming -----
@@ -486,4 +486,4 @@ def CreatePorts(ports = None):
winport = ports_translation[port.rstrip("012345678")] +\
str(int(port.lstrip("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")) + 1)
os.symlink("/dev/" + port, wineread.winepath + "/dosdevices/" + winport)
- \ No newline at end of file
+