Coder Social home page Coder Social logo

rye-tui's People

Contributors

zaloog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rye-tui's Issues

Syntax Warning on first run of `trye`

Installed via rye install rye-tui

On first run of trye I got this Syntax Warning.

❯ trye
/Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/rye_tui/components/modals.py:122: SyntaxWarning: invalid escape sequence '\.'
  validators=[Regex("^3\.(?:[89]|1[012])$")],
[21:33:31] Thank you for using "rye-tui".
           Since this is your first time using "rye-tui" a Configuration-File
           was created successfully.
           You can now use "trye" again to start working with rye-tui.

`trye` crashes on 2nd run

Following on from #1 - on my 2nd run of trye the TUI briefly appeared, but then it crashed with this error. Subsequent runs of trye all go straight to this error.

❯ trye --version
rye-tui 0.2.1
❯ sw_vers
ProductName:		macOS
ProductVersion:		13.6.5
trye
╭────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────────────────╮
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:365 in _run                                                                                     │
│                                                                                                                                                                                │
│   362 │   │   self.state = WorkerState.RUNNING                                                 ╭────────────────────────────────── locals ──────────────────────────────────╮  │
│   363 │   │   app.log.worker(self)                                                             │           app = RyeTui(title='RyeTui', classes={'-dark-mode'})             │  │
│   364 │   │   try:                                                                             │         error = KeyError('proxy')                                          │  │
│ ❱ 365 │   │   │   self._result = await self.run()                                              │          self = <Worker ERROR name='on_mount' description='on_mount()'>    │  │
│   366 │   │   except asyncio.CancelledError as error:                                          │     Traceback = <class 'rich.traceback.Traceback'>                         │  │
│   367 │   │   │   self.state = WorkerState.CANCELLED                                           │ worker_failed = WorkerFailed("Worker raised exception: KeyError('proxy')") │  │
│   368 │   │   │   self._error = error                                                          ╰────────────────────────────────────────────────────────────────────────────╯  │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:349 in run                                                                                      │
│                                                                                                                                                                                │
│   346 │   │   Returns:                                                                         ╭──────────────────────────── locals ────────────────────────────╮              │
│   347 │   │   │   Return value of the work.                                                    │ self = <Worker ERROR name='on_mount' description='on_mount()'> │              │
│   348 │   │   """                                                                              ╰────────────────────────────────────────────────────────────────╯              │
│ ❱ 349 │   │   return await (                                                                                                                                                   │
│   350 │   │   │   self._run_threaded() if self._thread_worker else self._run_async()                                                                                           │
│   351 │   │   )                                                                                                                                                                │
│   352                                                                                                                                                                          │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:321 in _run_threaded                                                                            │
│                                                                                                                                                                                │
│   318 │   │                                                                                                                                                                    │
│   319 │   │   loop = asyncio.get_running_loop()                                                                                                                                │
│   320 │   │   assert loop is not None                                                                                                                                          │
│ ❱ 321 │   │   return await loop.run_in_executor(None, runner, self._work)                                                                                                      │
│   322 │                                                                                                                                                                        │
│   323 │   async def _run_async(self) -> ResultType:                                                                                                                            │
│   324 │   │   """Run an async worker.                                                                                                                                          │
│                                                                                                                                                                                │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮                                                                                      │
│ │          loop = <_UnixSelectorEventLoop running=True closed=False debug=False>        │                                                                                      │
│ │ run_awaitable = <function Worker._run_threaded.<locals>.run_awaitable at 0x10c46a660> │                                                                                      │
│ │  run_callable = <function Worker._run_threaded.<locals>.run_callable at 0x10c468040>  │                                                                                      │
│ │ run_coroutine = <function Worker._run_threaded.<locals>.run_coroutine at 0x10c4680e0> │                                                                                      │
│ │        runner = <function Worker._run_threaded.<locals>.run_coroutine at 0x10c4680e0> │                                                                                      │
│ │          self = <Worker ERROR name='on_mount' description='on_mount()'>               │                                                                                      │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯                                                                                      │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/py/[email protected]/lib/python3.12/concurrent/futures/thread.py:58 in run                                                                                      │
│                                                                                                                                                                                │
│    55 │   │   │   return                                                                       ╭── locals ───╮                                                                 │
│    56 │   │                                                                                    │ self = None │                                                                 │
│    57 │   │   try:                                                                             ╰─────────────╯                                                                 │
│ ❱  58 │   │   │   result = self.fn(*self.args, **self.kwargs)                                                                                                                  │
│    59 │   │   except BaseException as exc:                                                                                                                                     │
│    60 │   │   │   self.future.set_exception(exc)                                                                                                                               │
│    61 │   │   │   # Break a reference cycle with the exception 'exc'                                                                                                           │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:299 in run_coroutine                                                                            │
│                                                                                                                                                                                │
│   296 │   │   │   work: Callable[[], Coroutine[None, None, ResultType]]                                                                                                        │
│   297 │   │   ) -> ResultType:                                                                                                                                                 │
│   298 │   │   │   """Set the active worker and await coroutine."""                                                                                                             │
│ ❱ 299 │   │   │   return run_awaitable(work())                                                                                                                                 │
│   300 │   │                                                                                                                                                                    │
│   301 │   │   def run_callable(work: Callable[[], ResultType]) -> ResultType:                                                                                                  │
│   302 │   │   │   """Set the active worker, and call the callable."""                                                                                                          │
│                                                                                                                                                                                │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮                                                                               │
│ │ run_awaitable = <function Worker._run_threaded.<locals>.run_awaitable at 0x10c46a660>        │                                                                               │
│ │          work = functools.partial(<function ConfigTab.on_mount at 0x10c33cea0>, ConfigTab()) │                                                                               │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯                                                                               │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:293 in run_awaitable                                                                            │
│                                                                                                                                                                                │
│   290 │   │   │   │   active_worker.set(self)                                                                                                                                  │
│   291 │   │   │   │   return await work                                                                                                                                        │
│   292 │   │   │                                                                                                                                                                │
│ ❱ 293 │   │   │   return asyncio.run(do_work())                                                                                                                                │
│   294 │   │                                                                                                                                                                    │
│   295 │   │   def run_coroutine(                                                                                                                                               │
│   296 │   │   │   work: Callable[[], Coroutine[None, None, ResultType]]                                                                                                        │
│                                                                                                                                                                                │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮                                                                           │
│ │ do_work = <function Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work at 0x10c46b1a0> │                                                                           │
│ │    self = <Worker ERROR name='on_mount' description='on_mount()'>                                │                                                                           │
│ │    work = <coroutine object ConfigTab.on_mount at 0x10c4957e0>                                   │                                                                           │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                           │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/py/[email protected]/lib/python3.12/asyncio/runners.py:194 in run                                                                                               │
│                                                                                                                                                                                │
│   191 │   │   │   "asyncio.run() cannot be called from a running event loop")                                                                                                  │
│   192 │                                                                                                                                                                        │
│   193 │   with Runner(debug=debug, loop_factory=loop_factory) as runner:                                                                                                       │
│ ❱ 194 │   │   return runner.run(main)                                                                                                                                          │
│   195                                                                                                                                                                          │
│   196                                                                                                                                                                          │
│   197 def _cancel_all_tasks(loop):                                                                                                                                             │
│                                                                                                                                                                                │
│ ╭─────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮                                                              │
│ │        debug = None                                                                                           │                                                              │
│ │ loop_factory = None                                                                                           │                                                              │
│ │         main = <coroutine object Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work at 0x10c46cd40> │                                                              │
│ │       runner = <asyncio.runners.Runner object at 0x10c443f20>                                                 │                                                              │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                              │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/py/[email protected]/lib/python3.12/asyncio/runners.py:118 in run                                                                                               │
│                                                                                                                                                                                │
│   115 │   │                                                                                                                                                                    │
│   116 │   │   self._interrupt_count = 0                                                                                                                                        │
│   117 │   │   try:                                                                                                                                                             │
│ ❱ 118 │   │   │   return self._loop.run_until_complete(task)                                                                                                                   │
│   119 │   │   except exceptions.CancelledError:                                                                                                                                │
│   120 │   │   │   if self._interrupt_count > 0:                                                                                                                                │
│   121 │   │   │   │   uncancel = getattr(task, "uncancel", None)                                                                                                               │
│                                                                                                                                                                                │
│ ╭────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────╮ │
│ │        context = <_contextvars.Context object at 0x10c44c640>                                                                                                              │ │
│ │           coro = <coroutine object Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work at 0x10c46cd40>                                                            │ │
│ │           self = <asyncio.runners.Runner object at 0x10c443f20>                                                                                                            │ │
│ │ sigint_handler = None                                                                                                                                                      │ │
│ │           task = <Task finished name='Task-430' coro=<Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work() done, defined at                                      │ │
│ │                  /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:289> exception=KeyError('proxy')>                                          │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/py/[email protected]/lib/python3.12/asyncio/base_events.py:687 in run_until_complete                                                                            │
│                                                                                                                                                                                │
│    684 │   │   if not future.done():                                                                                                                                           │
│    685 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')                                                                                           │
│    686 │   │                                                                                                                                                                   │
│ ❱  687 │   │   return future.result()                                                                                                                                          │
│    688 │                                                                                                                                                                       │
│    689 │   def stop(self):                                                                                                                                                     │
│    690 │   │   """Stop running the event loop.                                                                                                                                 │
│                                                                                                                                                                                │
│ ╭────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────╮ │
│ │   future = <Task finished name='Task-430' coro=<Worker._run_threaded.<locals>.run_awaitable.<locals>.do_work() done, defined at                                            │ │
│ │            /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:289> exception=KeyError('proxy')>                                                │ │
│ │ new_task = False                                                                                                                                                           │ │
│ │     self = <_UnixSelectorEventLoop running=False closed=True debug=False>                                                                                                  │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/textual/worker.py:291 in do_work                                                                                  │
│                                                                                                                                                                                │
│   288 │   │   │                                                                                ╭──────────────────────────── locals ────────────────────────────╮              │
│   289 │   │   │   async def do_work() -> ResultType:                                           │ self = <Worker ERROR name='on_mount' description='on_mount()'> │              │
│   290 │   │   │   │   active_worker.set(self)                                                  │ work = <coroutine object ConfigTab.on_mount at 0x10c4957e0>    │              │
│ ❱ 291 │   │   │   │   return await work                                                        ╰────────────────────────────────────────────────────────────────╯              │
│   292 │   │   │                                                                                                                                                                │
│   293 │   │   │   return asyncio.run(do_work())                                                                                                                                │
│   294                                                                                                                                                                          │
│                                                                                                                                                                                │
│ /Users/my1e5/.rye/tools/rye-tui/lib/python3.12/site-packages/rye_tui/components/config_tab.py:35 in on_mount                                                                   │
│                                                                                                                                                                                │
│    32 │   │   with self.prevent(Switch.Changed):                                               ╭────── locals ──────╮                                                          │
│    33 │   │   │   self.conf_default.load_current(conf_dict=self.rye_config["default"])         │ self = ConfigTab() │                                                          │
│    34 │   │   │   self.conf_behavior.load_current(conf_dict=self.rye_config["behavior"])       ╰────────────────────╯                                                          │
│ ❱  35 │   │   │   self.conf_proxy.load_current(conf_dict=self.rye_config["proxy"])                                                                                             │
│    36                                                                                                                                                                          │
│    37                                                                                                                                                                          │
│    38 ########################################################################################                                                                                 │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'proxy'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.