Multiplatform shebangs
This commit is contained in:
parent
01d99b818f
commit
f39c28168b
3 changed files with 13 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from modules import configloader
|
from modules import configloader
|
||||||
from modules import compressor
|
from modules import compressor
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!python3
|
#!/usr/bin/env python3
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import colorama
|
import colorama
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
#!/usr/bin/env python3
|
||||||
#!/usr/bin/env python
|
|
||||||
#
|
#
|
||||||
# Automatically converts VNDS to Ren'Py.
|
# Automatically converts VNDS to Ren'Py.
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ def scan_setvar(l):
|
||||||
|
|
||||||
with zipfile.ZipFile("script.zip", 'r') as zip_ref:
|
with zipfile.ZipFile("script.zip", 'r') as zip_ref:
|
||||||
zip_ref.extractall()
|
zip_ref.extractall()
|
||||||
|
|
||||||
def scan_script(infn):
|
def scan_script(infn):
|
||||||
inf = open("script/" + infn, encoding="utf-8")
|
inf = open("script/" + infn, encoding="utf-8")
|
||||||
|
|
||||||
|
@ -108,7 +107,7 @@ def convert_goto(cs, l):
|
||||||
l = l.replace("-", "_")
|
l = l.replace("-", "_")
|
||||||
|
|
||||||
cs.write("jump %s", l)
|
cs.write("jump %s", l)
|
||||||
|
|
||||||
def convert_choice(cs, l):
|
def convert_choice(cs, l):
|
||||||
choices = l.split("|")
|
choices = l.split("|")
|
||||||
|
|
||||||
|
@ -158,7 +157,7 @@ def convert_gsetvar(cs, l):
|
||||||
cs.write("$ persistent.%s -= %s", var, val)
|
cs.write("$ persistent.%s -= %s", var, val)
|
||||||
else:
|
else:
|
||||||
raise Exception("Unknown operation " + op)
|
raise Exception("Unknown operation " + op)
|
||||||
|
|
||||||
def convert_if(cs, l):
|
def convert_if(cs, l):
|
||||||
var, rest = l.strip().split(' ', 1)
|
var, rest = l.strip().split(' ', 1)
|
||||||
var = unjp(var)
|
var = unjp(var)
|
||||||
|
@ -170,7 +169,7 @@ def convert_if(cs, l):
|
||||||
cs.indent()
|
cs.indent()
|
||||||
|
|
||||||
cs.empty_block = True
|
cs.empty_block = True
|
||||||
|
|
||||||
def convert_fi(cs, l):
|
def convert_fi(cs, l):
|
||||||
if cs.empty_block:
|
if cs.empty_block:
|
||||||
cs.write("pass")
|
cs.write("pass")
|
||||||
|
@ -192,7 +191,7 @@ def convert_setimg(cs, l):
|
||||||
|
|
||||||
cs.write("show expression %r as i%d at fgpos(%d, %d)", fn, cs.imindex, x, y)
|
cs.write("show expression %r as i%d at fgpos(%d, %d)", fn, cs.imindex, x, y)
|
||||||
cs.imindex += 1
|
cs.imindex += 1
|
||||||
|
|
||||||
def convert_delay(cs, l):
|
def convert_delay(cs, l):
|
||||||
try:
|
try:
|
||||||
t = int(l) / 60.0
|
t = int(l) / 60.0
|
||||||
|
@ -200,8 +199,8 @@ def convert_delay(cs, l):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def convert_bgload(cs, fn):
|
def convert_bgload(cs, fn):
|
||||||
|
|
||||||
if " " in fn:
|
if " " in fn:
|
||||||
|
@ -219,7 +218,7 @@ def convert_bgload(cs, fn):
|
||||||
|
|
||||||
if delay:
|
if delay:
|
||||||
cs.write("with Dissolve(%f)", delay)
|
cs.write("with Dissolve(%f)", delay)
|
||||||
|
|
||||||
def convert_jump(cs, fn):
|
def convert_jump(cs, fn):
|
||||||
if " " in fn:
|
if " " in fn:
|
||||||
fn, l = fn.split(" ", 1)
|
fn, l = fn.split(" ", 1)
|
||||||
|
@ -231,7 +230,7 @@ def convert_jump(cs, fn):
|
||||||
|
|
||||||
fn = fn.replace(".scr", "").replace("-", "_")
|
fn = fn.replace(".scr", "").replace("-", "_")
|
||||||
cs.write("jump %s", fn)
|
cs.write("jump %s", fn)
|
||||||
|
|
||||||
def convert_music(cs, fn):
|
def convert_music(cs, fn):
|
||||||
if " " in fn:
|
if " " in fn:
|
||||||
fn, loops = fn.split(" ", 1)
|
fn, loops = fn.split(" ", 1)
|
||||||
|
@ -248,7 +247,7 @@ def convert_music(cs, fn):
|
||||||
else:
|
else:
|
||||||
fn = "sound/" + fn
|
fn = "sound/" + fn
|
||||||
cs.write("play music %r%s", fn, noloop)
|
cs.write("play music %r%s", fn, noloop)
|
||||||
|
|
||||||
def convert_text(cs, text):
|
def convert_text(cs, text):
|
||||||
|
|
||||||
while text and (text[0] == "~" or text[0] == "!"):
|
while text and (text[0] == "~" or text[0] == "!"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue