ui/urwid: drop customizing color palettes

This commit is contained in:
rr-
2019-01-13 17:33:11 +01:00
parent 9fc078ad94
commit 1980049c6f
2 changed files with 0 additions and 30 deletions
-21
View File
@@ -1,10 +1,8 @@
import argparse
import json
import typing as T
from pathlib import Path
import urwid
import xdg
from pqcli import lingo, random
from pqcli.mechanic import Player
@@ -30,21 +28,6 @@ PALETTE: T.List[T.Tuple[str, ...]] = [
("scrollable", "", ""),
("scrollable-focus", "", ""),
]
PALETTE_PATH = Path(xdg.XDG_CONFIG_HOME) / "pqcli" / "palette.json"
def load_palette() -> bool:
global PALETTE
if PALETTE_PATH.exists():
PALETTE = json.loads(PALETTE_PATH.read_text())
return True
return False
def save_palette() -> None:
global PALETTE
PALETTE_PATH.parent.mkdir(exist_ok=True, parents=True)
PALETTE_PATH.write_text(json.dumps(PALETTE, indent=4))
class ConfirmExitDialog(ConfirmView):
@@ -69,10 +52,6 @@ class UrwidUserInterface(BaseUserInterface):
bind_commands()
if args.use_config:
if not load_palette():
save_palette() # create a file for the user to edit
self.loop = urwid.MainLoop(
None, PALETTE, unhandled_input=self.unhandled_input
)