diff --git a/nightwatch/__main__.py b/nightwatch/__main__.py index fd1cfd0..1fa4c3b 100644 --- a/nightwatch/__main__.py +++ b/nightwatch/__main__.py @@ -3,6 +3,20 @@ # Initialization def main() -> None: + # Check urwid + def invalid_urwid_distrib(): + exit("ERROR: Nightwatch requires urwid to have a specific unicode patch not currently included in upstream urwid.\n\n" \ + "To fix this, run:\npip install -U urwid@git+https://github.com/iiPythonx/urwid\n\n" \ + "and relaunch Nightwatch.") + + try: + from urwid import is_iipython_urwid + if not is_iipython_urwid: + invalid_urwid_distrib() + + except ImportError: + invalid_urwid_distrib() + # Modules from argparse import ArgumentParser from nightwatch.client import start_client diff --git a/pyproject.toml b/pyproject.toml index f421a21..73e3e02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ dependencies = [ "websockets", "orjson", - "urwid@git+https://github.com/iiPythonx/urwid", + "urwid", # NEEDED: urwid@git+https://github.com/iiPythonx/urwid "nanoid" ]