objexplore icon indicating copy to clipboard operation
objexplore copied to clipboard

__init__() got an unexpected keyword argument 'subtitle'

Open volkswagenfeature opened this issue 3 years ago • 1 comments
trafficstars

Describe the bug

Newly installed through conda-forge, opened in python to check out features... Immediately got exception.

>>> import objexplore as obex
>>> obex.inspect(obex)
TypeError: __init__() got an unexpected keyword argument 'subtitle'
>>> import objexplore as obex2
>>> obex.inspect(obex2)
TypeError: __init__() got an unexpected keyword argument 'subtitle'
>>> quit()

New instance:

>>> import objexplore as obex
>>> obex.inspect(int)
TypeError: __init__() got an unexpected keyword argument 'subtitle'

Traceback

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/tristan/micromamba/envs/psychScraper/lib/python3.9/site-packages/objexplore/objexplore.py: │
│ 446 in explore                                                                                   │
│                                                                                                  │
│   443 │   name = frame.f_back.f_code.co_names[1]  # type: ignore                                 │
│   444 │   app = ObjExploreApp(obj, name=name)                                                    │
│   445 │   try:                                                                                   │
│ ❱ 446 │   │   return app.explore()                                                               │
│   447 │                                                                                          │
│   448 │   except Exception as err:                                                               │
│   449 │   │   print(app.term.move_down(app.term.height))                                         │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   app = <objexplore.objexplore.ObjExploreApp object at 0x7fa5025d0f40>                       │ │
│ │   err = TypeError("__init__() got an unexpected keyword argument 'subtitle'")                │ │
│ │ frame = <frame at 0x7fa501913040, file                                                       │ │
│ │         '/home/tristan/micromamba/envs/psychScraper/lib/python3.9/site-packages/objexplore/… │ │
│ │         line 450, code explore>                                                              │ │
│ │  name = 'explore'                                                                            │ │
│ │   obj = <class 'int'>                                                                        │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/tristan/micromamba/envs/psychScraper/lib/python3.9/site-packages/objexplore/objexplore.py: │
│ 71 in explore                                                                                    │
│                                                                                                  │
│    68 │   │   with self.term.cbreak(), self.term.hidden_cursor():                                │
│    69 │   │   │   while True:                                                                    │
│    70 │   │   │   │   try:                                                                       │
│ ❱  71 │   │   │   │   │   self.draw()                                                            │
│    72 │   │   │   │   │   key = self.term.inkey()                                                │
│    73 │   │   │   │   │   self.process_key_event(key)                                            │
│    74                                                                                            │
│                                                                                                  │
│ ╭─────────────────────────────── locals ────────────────────────────────╮                        │
│ │  key = None                                                           │                        │
│ │  res = None                                                           │                        │
│ │ self = <objexplore.objexplore.ObjExploreApp object at 0x7fa5025d0f40> │                        │
│ ╰───────────────────────────────────────────────────────────────────────╯                        │
│                                                                                                  │
│ /home/tristan/micromamba/envs/psychScraper/lib/python3.9/site-packages/objexplore/objexplore.py: │
│ 386 in draw                                                                                      │
│                                                                                                  │
│   383 │   │   print(self.term.home, end="")                                                      │
│   384 │   │   layout = Layout()                                                                  │
│   385 │   │   layout.split_row(                                                                  │
│ ❱ 386 │   │   │   self.explorer.get_layout(),                                                    │
│   387 │   │   │   self.overview.get_layout(self.explorer.selected_object),                       │
│   388 │   │   )                                                                                  │
│   389                                                                                            │
│                                                                                                  │
│ ╭──────────────────────────────── locals ─────────────────────────────────╮                      │
│ │      _ = ()                                                             │                      │
│ │ layout = Layout()                                                       │                      │
│ │   self = <objexplore.objexplore.ObjExploreApp object at 0x7fa5025d0f40> │                      │
│ ╰─────────────────────────────────────────────────────────────────────────╯                      │
│                                                                                                  │
│ /home/tristan/micromamba/envs/psychScraper/lib/python3.9/site-packages/objexplore/explorer.py:10 │
│ 3 in get_layout                                                                                  │
│                                                                                                  │
│   100 │   │   │   top_panel = self.list_panel                                                    │
│   101 │   │                                                                                      │
│   102 │   │   else:                                                                              │
│ ❱ 103 │   │   │   top_panel = self.dir_panel                                                     │
│   104 │   │                                                                                      │
│   105 │   │   if self.filter.layout.visible:                                                     │
│   106 │   │   │   combined_layout = Layout()                                                     │
│                                                                                                  │
│ ╭───────────────────────────────── locals ──────────────────────────────────╮                    │
│ │ explorer_layout = Layout(size=34)                                         │                    │
│ │            self = <objexplore.explorer.Explorer object at 0x7fa5019128b0> │                    │
│ ╰───────────────────────────────────────────────────────────────────────────╯                    │
│                                                                                                  │
│ /home/tristan/micromamba/envs/psychScraper/lib/python3.9/site-packages/objexplore/explorer.py:24 │
│ 3 in dir_panel                                                                                   │
│                                                                                                  │
│   240 │   │   │   elif self.state == ExplorerState.private:                                      │
│   241 │   │   │   │   title = "[u]private"                                                       │
│   242 │   │                                                                                      │
│ ❱ 243 │   │   return Panel(                                                                      │
│   244 │   │   │   renderable,                                                                    │
│   245 │   │   │   title=title,                                                                   │
│   246 │   │   │   title_align="right",                                                           │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │           attr = 'to_bytes'                                                                  │ │
│ │     cached_obj = <objexplore.cached_object.CachedObject object at 0x7fa501912280>            │ │
│ │          index = 8                                                                           │ │
│ │           line = <text 'to_bytes()' [Span(8, 10, 'white')]>                                  │ │
│ │          lines = [                                                                           │ │
│ │                  │   <text 'as_integer_ratio()' [Span(16, 18, 'white')]>,                    │ │
│ │                  │   <text 'bit_length()' [Span(10, 12, 'white')]>,                          │ │
│ │                  │   <text 'conjugate()' [Span(9, 11, 'white')]>,                            │ │
│ │                  │   <text 'denominator' []>,                                                │ │
│ │                  │   <text 'from_bytes()' [Span(10, 12, 'white')]>,                          │ │
│ │                  │   <text 'imag' []>,                                                       │ │
│ │                  │   <text 'numerator' []>,                                                  │ │
│ │                  │   <text 'real' []>,                                                       │ │
│ │                  │   <text 'to_bytes()' [Span(8, 10, 'white')]>                              │ │
│ │                  ]                                                                           │ │
│ │     renderable = <text                                                                       │ │
│ │                  'as_integer_ratio()\nbit_length()\nconjugate()\ndenominator\nfrom_bytes()\… │ │
│ │                  [Span(0, 18, 'italic reverse cyan'), Span(16, 18, 'white'), Span(19, 31,    │ │
│ │                  'italic cyan'), Span(29, 31, 'white'), Span(32, 43, 'italic cyan'),         │ │
│ │                  Span(41, 43, 'white'), Span(56, 68, 'italic cyan'), Span(66, 68, 'white'),  │ │
│ │                  Span(89, 99, 'italic cyan'), Span(97, 99, 'white')]>                        │ │
│ │           self = <objexplore.explorer.Explorer object at 0x7fa5019128b0>                     │ │
│ │       subtitle = '[dim][u][][/u]:switch pane                                                 │ │
│ │                  [/dim][white]([/white][magenta]1[/magenta][white]/[/w'+33                   │ │
│ │  subtitle_help = '[dim][u][][/u]:switch pane [/dim]'                                         │ │
│ │ subtitle_index = '[white]([/white][magenta]1[/magenta][white]/[/white][magenta]9[/magenta][… │ │
│ │          title = '[i][cyan]dir[/cyan]()[/i] | [u]public[/u] [dim]private[/dim]'              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

Expected behavior

Beautifully formatted module contents

Additional context

Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50)
[GCC 10.3.0] on linux

Running under WSL

>>> objexplore.version
'1.6.3'
$> micromamba list objexplore
List of packages in environment: "/home/tristan/micromamba/envs/psychScraper"

  Name        Version  Build         Channel
──────────────────────────────────────────────────
  objexplore  1.6.3    pyhd8ed1ab_0  conda-forge

volkswagenfeature avatar Jul 04 '22 19:07 volkswagenfeature

Can you double check which version of rich you have installed? objexplore requires rich>=10.9.0

Rich has the subtitle attribute here: https://github.com/Textualize/rich/blob/master/rich/panel.py#L44=

kylepollina avatar Jul 07 '22 01:07 kylepollina