Beispiel #1
0
    def exec_txl(cls, txlprog, filepath, txlargs=None):
        directory, filename = os.path.split(filepath)
        directory = directory and directory or "."

        txlbin = DelphiCompiler.get_txl_binary(relative_to=directory)
        grammar_path = DelphiCompiler.get_txl_grammar_path(relative_to=directory)

        txlprog = os.path.join(grammar_path, txlprog)
        if not io.platform_is_linux():
            txlprog = io.path_cygwin_to_win(txlprog)

        txlargs = txlargs and txlargs or []

        return io.invoke([txlbin] + txlargs + [txlprog, filename], cwd=directory, return_all=True)
Beispiel #2
0
 def get_txl_prog(cls):
     grammar_path = DelphiCompiler.get_txl_grammar_path(relative_to=directory)
     txlprog = os.path.join(grammar_path, txlprog)
     return txlprog