Try again.

This commit is contained in:
Andrew Hamilton 2016-11-15 01:56:51 +01:00
parent 1c6a16c2fb
commit 746f067772

10
vigil
View file

@ -922,6 +922,8 @@ def main(root_path, loop, worker_count=None, is_sandboxed=True,
editor_command=None, theme=None, is_being_tested=False):
if worker_count is None:
worker_count = multiprocessing.cpu_count()
if theme is None:
theme = "native"
os.environ["PYGMENT_STYLE"] = theme
pickle_path = os.path.join(tools.CACHE_PATH, "summary.pickle")
jobs_added_event = asyncio.Event()
@ -1007,15 +1009,15 @@ def check_arguments():
print("--sandbox argument must be 'on' or 'off'")
sys.exit(1)
is_sandboxed = arguments["--sandbox"] in ["on", None]
theme = ("native" if arguments["--theme"] is None
else arguments["--theme"])
if arguments["--theme"] is not None:
themes = list(pygments.styles.get_all_styles())
if theme not in themes:
if arguments["--theme"] not in themes:
print("--theme must be one of: %s" % " ".join(themes))
sys.exit(1)
editor_command = arguments["--editor"] or os.environ.get("EDITOR", None)\
or os.environ.get("VISUAL", None)
return root_path, worker_count, is_sandboxed, editor_command, theme
return root_path, worker_count, is_sandboxed, editor_command, \
arguments["--theme"]
if __name__ == "__main__":