|
@@ -9,10 +9,6 @@ modTag = "mod"
|
|
|
|
|
|
file_path_html = 'glife.html'
|
|
|
file_path_mod = 'mods/mod.html'
|
|
|
-file_path_localmod = 'mods/glife_local_mod.html'
|
|
|
-file_path_remotemod = 'mods/glife_remote_mod.html'
|
|
|
-
|
|
|
-file_path_modloader = 'mods/util/ModloaderScript.txt'
|
|
|
|
|
|
data = ''
|
|
|
modData = ''
|
|
@@ -42,21 +38,14 @@ for match in re.finditer(regex,data,re.S):
|
|
|
scripts += match.group(1)
|
|
|
dataWithoutModStuff = dataWithoutModStuff.replace(match.group(0),'')
|
|
|
|
|
|
-modData += '<script>'+scripts+'</script>'
|
|
|
+modData += "\n.-.-.-. STORYDATA / SCRIPT .-.-.-.\n"
|
|
|
+
|
|
|
+modData += scripts
|
|
|
|
|
|
with open(file_path_mod, 'w') as file:
|
|
|
file.write(modData)
|
|
|
|
|
|
|
|
|
-data_localmod = dataWithoutModStuff.replace('</tw-storydata>',modData+'</tw-storydata>',1)
|
|
|
-with open(file_path_localmod, 'w') as file:
|
|
|
- file.write(data_localmod)
|
|
|
-
|
|
|
|
|
|
-with open(file_path_modloader, 'r') as file:
|
|
|
- modloader_data = file.read()
|
|
|
-data_remtotemod = re.sub(r"""(<script id="script-sugarcube" type="text/javascript">)(.*?)(</script>)""",r"""\1"""+modloader_data+r""" \2}\3""",dataWithoutModStuff,1, re.S)
|
|
|
-with open(file_path_remotemod, 'w') as file:
|
|
|
- file.write(data_remtotemod)
|
|
|
|
|
|
print('Done')
|