def run(self): if self.g is None: raise RuntimeError( "Expecting a grammar file: python setup.py update_grammars R.g4" ) grammar = self.g from pyensae.languages import build_grammar if not os.path.exists(grammar): cdir = os.path.abspath(os.path.dirname(__file__)) g2 = os.path.join(cdir, "src", "pyensae", "languages", grammar) if not os.path.exists(g2): raise FileNotFoundError("{0}\n{1}".format(grammar, g2)) grammar = g2 build_grammar(grammar, fLOG=logging_function) r = True
def run(self): if self.g is None: raise RuntimeError( "Expecting a grammar file: python setup.py update_grammars R.g4" ) grammar = self.g from pyensae.languages import build_grammar if not os.path.exists(grammar): cdir = os.path.abspath(os.path.dirname(__file__)) g2 = os.path.join(cdir, "src", "jupytalk", "mokadi", "grammars", grammar) if not os.path.exists(g2): raise FileNotFoundError("{0}\n{1}".format(grammar, g2)) grammar = g2 try: from pyensae.languages import build_grammar except ImportError: sys.path.append( os.path.join(os.path.dirname(__file__), "..", "pyensae", "src")) from pyensae.languages import build_grammar build_grammar(grammar, fLOG=logging_function)
if len(sys.argv) <= ind: raise Exception( "expecting a grammar file: python setup.py update_grammars R.g4" ) grammar = sys.argv[ind + 1] try: from pyensae.languages import build_grammar except ImportError: from src.pyensae.languages import build_grammar if not os.path.exists(grammar): cdir = os.path.abspath(os.path.dirname(__file__)) g2 = os.path.join(cdir, "src", "pyensae", "languages", grammar) if not os.path.exists(g2): raise FileNotFoundError("{0}\n{1}".format(grammar, g2)) grammar = g2 build_grammar(grammar, fLOG=logging_function) r = True if not r and not ({ "bdist_msi", "sdist", "bdist_wheel", "publish", "publish_doc", "register", "upload_docs", "bdist_wininst", "build_ext" } & set(sys.argv)): raise Exception("unable to interpret command line: " + str(sys.argv)) else: r = False if ask_help(): from pyquickhelper.pycode import process_standard_options_for_setup_help process_standard_options_for_setup_help(sys.argv) if not r:
"Expecting a grammar file: python setup.py update_grammars MokadiGrammar.g4") grammar = sys.argv[ind + 1] if not os.path.exists(grammar): cdir = os.path.abspath(os.path.dirname(__file__)) g2 = os.path.join(cdir, "src", "jupytalk", "mokadi", "grammars", grammar) if not os.path.exists(g2): raise FileNotFoundError("{0}\n{1}".format(grammar, g2)) grammar = g2 try: from pyensae.languages import build_grammar except ImportError: sys.path.append(os.path.join( os.path.dirname(__file__), "..", "pyensae", "src")) from pyensae.languages import build_grammar build_grammar(grammar, fLOG=logging_function) r = True if not r and not ({"bdist_msi", "sdist", "bdist_wheel", "publish", "publish_doc", "register", "upload_docs", "bdist_wininst", "build_ext"} & set(sys.argv)): raise Exception("unable to interpret command line: " + str(sys.argv)) else: r = False if ask_help(): from pyquickhelper.pycode import process_standard_options_for_setup_help process_standard_options_for_setup_help(sys.argv) if not r: if len(sys.argv) in (1, 2) and sys.argv[-1] in ("--help-commands",): from pyquickhelper.pycode import process_standard_options_for_setup_help
"'_UT_35_std' in outfile")) if not r and "update_grammars" in sys.argv: # expecting python setup.py update_grammars file ind = sys.argv.index("update_grammars") if len(sys.argv) <= ind: raise Exception( "expecting a grammar file: python setup.py update_grammars R.g4" ) grammar = sys.argv[ind + 1] if not os.path.exists(grammar): g2 = os.path.join("src", "pyensae", "languages", grammar) if not os.path.exists(g2): raise FileNotFoundError(grammar) grammar = g2 from pyensae.languages import build_grammar build_grammar(grammar) r = True if not r and not ({ "bdist_msi", "sdist", "bdist_wheel", "publish", "publish_doc", "register", "upload_docs", "bdist_wininst" } & set(sys.argv)): raise Exception("unable to interpret command line: " + str(sys.argv)) else: r = False if not r: if len(sys.argv) in (1, 2) and sys.argv[-1] in ("--help-commands", ): pyquickhelper = import_pyquickhelper() from pyquickhelper.pycode import process_standard_options_for_setup_help process_standard_options_for_setup_help(sys.argv)
omit=["*Parser.py", "*Listener.py", "*Lexer.py"]), fLOG=logging_function, covtoken=("f929c9b3-bf00-4928-906a-b1dc54d5a5d9", "'_UT_35_std' in outfile")) if not r and "update_grammars" in sys.argv: # expecting python setup.py update_grammars file ind = sys.argv.index("update_grammars") if len(sys.argv) <= ind: raise Exception( "expecting a grammar file: python setup.py update_grammars R.g4") grammar = sys.argv[ind + 1] if not os.path.exists(grammar): g2 = os.path.join("src", "pyensae", "languages", grammar) if not os.path.exists(g2): raise FileNotFoundError(grammar) grammar = g2 from pyensae.languages import build_grammar build_grammar(grammar) r = True if not r and not ({"bdist_msi", "sdist", "bdist_wheel", "publish", "publish_doc", "register", "upload_docs", "bdist_wininst"} & set(sys.argv)): raise Exception("unable to interpret command line: " + str(sys.argv)) else: r = False if not r: if len(sys.argv) in (1, 2) and sys.argv[-1] in ("--help-commands",): pyquickhelper = import_pyquickhelper() from pyquickhelper.pycode import process_standard_options_for_setup_help process_standard_options_for_setup_help(sys.argv) setup(