mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-27 05:58:16 +03:00
Make proton, gen_wrapper and user_settings python scripts version-agnostic
This commit is contained in:
parent
2863402e9e
commit
9c3667c083
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
|
|
||||||
#NOTE: If you make modifications here, consider whether they should
|
#NOTE: If you make modifications here, consider whether they should
|
||||||
#be duplicated in ../vrclient/gen_wrapper.py
|
#be duplicated in ../vrclient/gen_wrapper.py
|
||||||
@ -502,7 +502,7 @@ for sdkver in sdk_versions:
|
|||||||
|
|
||||||
diagnostics = list(tu.diagnostics)
|
diagnostics = list(tu.diagnostics)
|
||||||
if len(diagnostics) > 0:
|
if len(diagnostics) > 0:
|
||||||
print 'There were parse errors'
|
print('There were parse errors')
|
||||||
pprint.pprint(diagnostics)
|
pprint.pprint(diagnostics)
|
||||||
else:
|
else:
|
||||||
children = list(tu.cursor.get_children())
|
children = list(tu.cursor.get_children())
|
||||||
|
16
proton
16
proton
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python
|
||||||
|
|
||||||
#script to launch Wine with the correct environment
|
#script to launch Wine with the correct environment
|
||||||
|
|
||||||
@ -309,7 +309,8 @@ if "nod3d11" in config_opts:
|
|||||||
del dlloverrides["dxgi"]
|
del dlloverrides["dxgi"]
|
||||||
|
|
||||||
s = ""
|
s = ""
|
||||||
for dll, setting in dlloverrides.items():
|
for dll in dlloverrides:
|
||||||
|
setting = dlloverrides[dll]
|
||||||
if len(s) > 0:
|
if len(s) > 0:
|
||||||
s = s + ";" + dll + "=" + setting
|
s = s + ";" + dll + "=" + setting
|
||||||
else:
|
else:
|
||||||
@ -457,6 +458,13 @@ def run():
|
|||||||
else:
|
else:
|
||||||
run_wine([wine_path] + sys.argv[2:])
|
run_wine([wine_path] + sys.argv[2:])
|
||||||
|
|
||||||
|
if sys.version_info[0] == 2:
|
||||||
|
binary_stdout = sys.stdout
|
||||||
|
elif sys.version_info[0] == 3:
|
||||||
|
binary_stdout = sys.stdout.buffer
|
||||||
|
else:
|
||||||
|
raise Exception("Unsuported python version")
|
||||||
|
|
||||||
#determine mode
|
#determine mode
|
||||||
if sys.argv[1] == "run":
|
if sys.argv[1] == "run":
|
||||||
#start target app
|
#start target app
|
||||||
@ -469,11 +477,11 @@ elif sys.argv[1] == "waitforexitandrun":
|
|||||||
elif sys.argv[1] == "getcompatpath":
|
elif sys.argv[1] == "getcompatpath":
|
||||||
#linux -> windows path
|
#linux -> windows path
|
||||||
path = subprocess.check_output([wine_path, "winepath", "-w", sys.argv[2]], env=env, stderr=lfile)
|
path = subprocess.check_output([wine_path, "winepath", "-w", sys.argv[2]], env=env, stderr=lfile)
|
||||||
sys.stdout.write(path.decode('utf-8'))
|
binary_stdout.write(path)
|
||||||
elif sys.argv[1] == "getnativepath":
|
elif sys.argv[1] == "getnativepath":
|
||||||
#windows -> linux path
|
#windows -> linux path
|
||||||
path = subprocess.check_output([wine_path, "winepath", sys.argv[2]], env=env, stderr=lfile)
|
path = subprocess.check_output([wine_path, "winepath", sys.argv[2]], env=env, stderr=lfile)
|
||||||
sys.stdout.write(path.decode('utf-8'))
|
binary_stdout.write(path)
|
||||||
else:
|
else:
|
||||||
log("Need a verb.")
|
log("Need a verb.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python2.7
|
#!/usr/bin/env python
|
||||||
|
|
||||||
#to enable these settings, name this file "user_settings.py"
|
#to enable these settings, name this file "user_settings.py"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python
|
||||||
|
|
||||||
#NOTE: If you make modifications here, consider whether they should
|
#NOTE: If you make modifications here, consider whether they should
|
||||||
#be duplicated in ../lsteamclient/gen_wrapper.py
|
#be duplicated in ../lsteamclient/gen_wrapper.py
|
||||||
@ -403,7 +403,7 @@ def get_capi_thunk_params(method):
|
|||||||
def toBOOL(x):
|
def toBOOL(x):
|
||||||
return "TRUE" if x else "FALSE"
|
return "TRUE" if x else "FALSE"
|
||||||
returns_record = method.result_type.get_canonical().kind == clang.cindex.TypeKind.RECORD
|
returns_record = method.result_type.get_canonical().kind == clang.cindex.TypeKind.RECORD
|
||||||
param_types = map(lambda x: x.type, get_params(method))
|
param_types = [x.type for x in get_params(method)]
|
||||||
if returns_record:
|
if returns_record:
|
||||||
param_types.insert(0, method.result_type)
|
param_types.insert(0, method.result_type)
|
||||||
param_count = len(param_types)
|
param_count = len(param_types)
|
||||||
@ -970,7 +970,7 @@ for sdkver in sdk_versions:
|
|||||||
|
|
||||||
diagnostics = list(tu.diagnostics)
|
diagnostics = list(tu.diagnostics)
|
||||||
if len(diagnostics) > 0:
|
if len(diagnostics) > 0:
|
||||||
print 'There were parse errors'
|
print('There were parse errors')
|
||||||
pprint.pprint(diagnostics)
|
pprint.pprint(diagnostics)
|
||||||
else:
|
else:
|
||||||
children = list(tu.cursor.get_children())
|
children = list(tu.cursor.get_children())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user