prefixLocation no longer holds the prefix itself
also listing pre-existing prefixes now
This commit is contained in:
parent
77c14edd2b
commit
372771b98e
|
@ -14,5 +14,5 @@
|
|||
|
||||
[DEFAULT]
|
||||
userName = User
|
||||
prefixLocation = $sd+/prefixes/+$prefix
|
||||
homeLocation = $config:DEFAULT/prefixLocation+/home
|
||||
prefixLocation = $sd+/prefixes
|
||||
homeLocation = $config:DEFAULT/prefixLocation+/+$prefix+/home
|
19
fwinebox.py
19
fwinebox.py
|
@ -11,8 +11,8 @@ p = os.path.join
|
|||
config = configparser.ConfigParser()
|
||||
config["DEFAULT"] = {
|
||||
"userName": "User",
|
||||
"prefixLocation": "$sd+/prefixes/+$prefix",
|
||||
"homeLocation": "$config:DEFAULT/prefixLocation+/home"
|
||||
"prefixLocation": "$sd+/prefixes",
|
||||
"homeLocation": "$config:DEFAULT/prefixLocation+/+$prefix+/home"
|
||||
}
|
||||
|
||||
configVars = {
|
||||
|
@ -63,7 +63,7 @@ def launchPrefix(prefix,cmd,raw = False):
|
|||
user = os.environ["USER"]
|
||||
os.environ["USER"] = cv(config["DEFAULT"]["userName"])
|
||||
os.environ["HOME"] = cv(config["DEFAULT"]["homeLocation"])
|
||||
os.environ["WINEPREFIX"] = cv(config["DEFAULT"]["prefixLocation"])
|
||||
os.environ["WINEPREFIX"] = p(cv(config["DEFAULT"]["prefixLocation"]),prefix)
|
||||
if raw == False:
|
||||
subprocess.call(["wine"] + cmd)
|
||||
else:
|
||||
|
@ -76,10 +76,14 @@ def launchPrefix(prefix,cmd,raw = False):
|
|||
|
||||
def main():
|
||||
while True:
|
||||
prefix = input("prefix: ")
|
||||
configVars["prefix"] = prefix
|
||||
prefixFolder = cv(config["DEFAULT"]["prefixLocation"])
|
||||
del configVars["prefix"]
|
||||
prefixLocation = cv(config["DEFAULT"]["prefixLocation"])
|
||||
print("list of prefixes:")
|
||||
for root,dirs,files in walklevel(prefixLocation):
|
||||
for dir in dirs:
|
||||
print(dir)
|
||||
|
||||
prefix = input("\nprefix: ")
|
||||
prefixFolder = p(prefixLocation,prefix)
|
||||
|
||||
if not os.path.isdir(prefixFolder):
|
||||
while True:
|
||||
|
@ -103,6 +107,7 @@ def main():
|
|||
break
|
||||
|
||||
if os.path.isdir(prefixFolder):
|
||||
print("\nlaunching " +prefix+ "...")
|
||||
launchPrefix(prefix,["cmd"])
|
||||
print("\nended wine-session")
|
||||
|
||||
|
|
Loading…
Reference in New Issue