Esempio n. 1
0
 def get_txl_binary(cls, relative_to=None):
     txl_binary = cls.txl_binary_win
     if io.platform_is_linux():
         txl_binary = cls.txl_binary_linux
     return os.path.join(cls.get_basepath(cls.basepath_txlbin_rel,
                                          relative_to=relative_to),
                         *txl_binary)
Esempio n. 2
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)