Rework the "cli" to a server instead
This commit is contained in:
10
pyfa.py
10
pyfa.py
@@ -74,19 +74,9 @@ parser.add_option("-s", "--savepath", action="store", dest="savepath", help="Set
|
||||
parser.add_option("-l", "--logginglevel", action="store", dest="logginglevel", help="Set desired logging level [Critical|Error|Warning|Info|Debug]", default="Error")
|
||||
parser.add_option("-p", "--profile", action="store", dest="profile_path", help="Set location to save profileing.", default=None)
|
||||
parser.add_option("-i", "--language", action="store", dest="language", help="Sets the language for pyfa. Overrides user's saved settings. Format: xx_YY (eg: en_US). If translation doesn't exist, defaults to en_US", default=None)
|
||||
parser.add_option("--headless", action="store_true", dest="headless", help="Run CLI stats only: read JSON fit from first positional arg (or stdin), print stats JSON to stdout, then exit. No GUI.", default=False)
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if getattr(options, "headless", False):
|
||||
from scripts.pyfa_cli_stats import main as headless_main
|
||||
headless_argv = []
|
||||
if options.savepath:
|
||||
headless_argv.extend(["--savepath", options.savepath])
|
||||
if args:
|
||||
headless_argv.append(args[0])
|
||||
sys.exit(headless_main(headless_argv))
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user