Index: grammalecte-server.py ================================================================== --- grammalecte-server.py +++ grammalecte-server.py @@ -21,11 +21,10 @@ #### GRAMMAR CHECKER #### oGrammarChecker = grammalecte.GrammarChecker("fr", "Server") oSpellChecker = oGrammarChecker.getSpellChecker() -oLexicographer = oGrammarChecker.getLexicographer() oTextFormatter = oGrammarChecker.getTextFormatter() oGCE = oGrammarChecker.getGCEngine() xProcessPoolExecutor = None @@ -295,11 +294,11 @@ return False #### START #### -def main (sHost="localhost", nPort=8080, dOptions=None, bTestPage=False): +def main (sHost="localhost", nPort=8080, dOptions=None, bTestPage=False, nMultiProc=None): "start server" global TESTPAGE global HOMEPAGE if bTestPage: @@ -318,10 +317,11 @@ if __name__ == '__main__': xParser = argparse.ArgumentParser() #xParser.add_argument("lang", type=str, nargs='+', help="lang project to generate (name of folder in /lang)") xParser.add_argument("-ht", "--host", help="host (default: localhost)", type=str) xParser.add_argument("-p", "--port", help="port (default: 8080)", type=int) + xParser.add_argument("-mp", "--multiprocessor", help="define how many processes for the grammar checker", type=int) xParser.add_argument("-t", "--test_page", help="page to test the server on /", action="store_true") xParser.add_argument("-on", "--opt_on", nargs="+", help="activate options") xParser.add_argument("-off", "--opt_off", nargs="+", help="deactivate options") xArgs = xParser.parse_args() @@ -330,10 +330,13 @@ dOpt = {} if xArgs.opt_on: dOpt = { opt:True for opt in xArgs.opt_on } if xArgs.opt_off: dOpt.update({ opt:False for opt in xArgs.opt_off }) + + print(xArgs.multiprocessor) main(xArgs.host or "localhost", \ xArgs.port or 8080, \ dOpt, - xArgs.test_page) + xArgs.test_page, + xArgs.multiprocessor)