Bug fix
* Fix detection of orphaned script and clarify the exception
This commit is contained in:
parent
e295fbb791
commit
8aa1a84efb
@ -26,26 +26,25 @@ python early:
|
|||||||
UNDERLINE = '\033[4;37;48m'
|
UNDERLINE = '\033[4;37;48m'
|
||||||
END = '\033[1;37;0m'
|
END = '\033[1;37;0m'
|
||||||
|
|
||||||
if config.developer:
|
# Debug
|
||||||
# Debug
|
# Note: config.developer flag is set to False during early initialisation
|
||||||
|
def detect_orphaned_rpyc_files():
|
||||||
|
excluded = ["tl/", "00db.rpyc", "00sshtransition.rpyc"]
|
||||||
|
|
||||||
def detect_orphaned_rpyc_files():
|
files = renpy.list_files(common=True)
|
||||||
excluded = ["tl/"]
|
|
||||||
|
|
||||||
files = renpy.list_files(common=True)
|
compiled = [x for x in files if x.endswith(".rpyc") if not any(x.startswith(i) for i in excluded)]
|
||||||
compiled = [x for x in files if x.endswith(".rpyc") if not any(x.startswith(i) for i in excluded)]
|
scripts = [x for x in files if x.endswith(".rpy")]
|
||||||
scripts = [x for x in files if x.endswith(".rpy")]
|
orphaned = []
|
||||||
orphaned = []
|
|
||||||
|
|
||||||
for i in compiled:
|
for i in compiled:
|
||||||
if not i[:-1] in scripts:
|
if not i[:-1] in scripts:
|
||||||
orphaned.append(i)
|
orphaned.append(i)
|
||||||
|
|
||||||
if orphaned:
|
if orphaned:
|
||||||
raise Exception(f"Orphaned compiled scripts detected, please delete them before continuing:\n{orphaned}")
|
raise Exception(f"Orphaned compiled scripts detected, please force recompile in Ren'py Launcher before continuing:\n{orphaned}")
|
||||||
|
|
||||||
detect_orphaned_rpyc_files()
|
|
||||||
|
|
||||||
|
detect_orphaned_rpyc_files()
|
||||||
|
|
||||||
# class InstanceDebugger(object):
|
# class InstanceDebugger(object):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user