Fixed a bug. There is a default theme.
This commit is contained in:
parent
24c096bd1a
commit
1c6a16c2fb
1 changed files with 4 additions and 5 deletions
9
vigil
9
vigil
|
|
@ -922,8 +922,6 @@ def main(root_path, loop, worker_count=None, is_sandboxed=True,
|
||||||
editor_command=None, theme=None, is_being_tested=False):
|
editor_command=None, theme=None, is_being_tested=False):
|
||||||
if worker_count is None:
|
if worker_count is None:
|
||||||
worker_count = multiprocessing.cpu_count()
|
worker_count = multiprocessing.cpu_count()
|
||||||
if theme == None:
|
|
||||||
theme = "native"
|
|
||||||
os.environ["PYGMENT_STYLE"] = theme
|
os.environ["PYGMENT_STYLE"] = theme
|
||||||
pickle_path = os.path.join(tools.CACHE_PATH, "summary.pickle")
|
pickle_path = os.path.join(tools.CACHE_PATH, "summary.pickle")
|
||||||
jobs_added_event = asyncio.Event()
|
jobs_added_event = asyncio.Event()
|
||||||
|
|
@ -1009,14 +1007,15 @@ def check_arguments():
|
||||||
print("--sandbox argument must be 'on' or 'off'")
|
print("--sandbox argument must be 'on' or 'off'")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
is_sandboxed = arguments["--sandbox"] in ["on", None]
|
is_sandboxed = arguments["--sandbox"] in ["on", None]
|
||||||
|
theme = ("native" if arguments["--theme"] is None
|
||||||
|
else arguments["--theme"])
|
||||||
themes = list(pygments.styles.get_all_styles())
|
themes = list(pygments.styles.get_all_styles())
|
||||||
if arguments["--theme"] not in themes:
|
if theme not in themes:
|
||||||
print("--theme must be one of: %s" % " ".join(themes))
|
print("--theme must be one of: %s" % " ".join(themes))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
editor_command = arguments["--editor"] or os.environ.get("EDITOR", None)\
|
editor_command = arguments["--editor"] or os.environ.get("EDITOR", None)\
|
||||||
or os.environ.get("VISUAL", None)
|
or os.environ.get("VISUAL", None)
|
||||||
return root_path, worker_count, is_sandboxed, editor_command, \
|
return root_path, worker_count, is_sandboxed, editor_command, theme
|
||||||
arguments["--theme"]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue