Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__init__() got an unexpected keyword argument 'subtitle' #3

Closed
RhetTbull opened this issue Sep 18, 2021 · 0 comments
Closed

__init__() got an unexpected keyword argument 'subtitle' #3

RhetTbull opened this issue Sep 18, 2021 · 0 comments

Comments

@RhetTbull
Copy link
Contributor

Describe the bug
Using explore() with rich < 10.8.0 installed causes "unexpected keyword argument 'subtitle'" error. requirements.txt specifies rich==10.9.0 but because setup.py does not, pip happily installs objexplore if an older rich version is already installed.

pip install objexplore
Collecting objexplore
  Downloading objexplore-1.2.3-py3-none-any.whl (14 kB)
Requirement already satisfied: rich in /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages (from objexplore) (10.6.0)
...

Traceback

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages/objexplore/objexplore.py │
│ :326 in explore                                                                                  │
│                                                                                                  │
│   323 │   """ Run the explorer on the given object """                                           │
│   324 │   try:                                                                                   │
│   325 │   │   e = Explorer(obj)                                                                  │
│ ❱ 326 │   │   return e.explore()                                                                 │
│   327 │   except Exception as e:                                                                 │
│   328 │   │   console.print_exception(show_locals=True)                                          │
│   329 │   │   print()                                                                            │
│                                                                                                  │
│ ╭────────────────────────────────── locals ───────────────────────────────────╮                  │
│ │   e = TypeError("__init__() got an unexpected keyword argument 'subtitle'") │                  │
│ │ obj = <class 'osxphotos.photoinfo.photoinfo.PhotoInfo'>                     │                  │
│ ╰─────────────────────────────────────────────────────────────────────────────╯                  │
│                                                                                                  │
│ /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages/objexplore/objexplore.py │
│ :74 in explore                                                                                   │
│                                                                                                  │
│    71 │   │   with self.term.cbreak(), self.term.hidden_cursor():                                │
│    72 │   │   │   while key not in ("q", "Q"):                                                   │
│    73 │   │   │   │   try:                                                                       │
│ ❱  74 │   │   │   │   │   self.draw()                                                            │
│    75 │   │   │   │   │   key = self.term.inkey()                                                │
│    76 │   │   │   │   │   res = self.process_key_event(key)                                      │
│    77                                                                                            │
│                                                                                                  │
│ ╭───────────────────────────── locals ─────────────────────────────╮                             │
│ │  key = None                                                      │                             │
│ │  res = None                                                      │                             │
│ │ self = <objexplore.objexplore.Explorer object at 0x7fe59d3d93d0> │                             │
│ ╰──────────────────────────────────────────────────────────────────╯                             │
│                                                                                                  │
│ /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages/objexplore/objexplore.py │
│ :295 in draw                                                                                     │
│                                                                                                  │
│   292 │   │   print(self.term.home, end="")                                                      │
│   293 │   │   layout = Layout()                                                                  │
│   294 │   │                                                                                      │
│ ❱ 295 │   │   layout.split_row(self.get_explorer_layout(), self.get_overview_layout())           │
│   296 │   │                                                                                      │
│   297 │   │   title = self.cached_obj.title                                                      │
│   298                                                                                            │
│                                                                                                  │
│ ╭────────────────────────────── locals ──────────────────────────────╮                           │
│ │   args = ()                                                        │                           │
│ │ layout = Layout()                                                  │                           │
│ │   self = <objexplore.objexplore.Explorer object at 0x7fe59d3d93d0> │                           │
│ ╰────────────────────────────────────────────────────────────────────╯                           │
│                                                                                                  │
│ /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages/objexplore/objexplore.py │
│ :276 in get_explorer_layout                                                                      │
│                                                                                                  │
│   273 │   │   │   )                                                                              │
│   274 │   │   │   return layout                                                                  │
│   275 │   │   else:                                                                              │
│ ❱ 276 │   │   │   return self.explorer_layout(                                                   │
│   277 │   │   │   │   term_width=self.term.width, term_height=self.term.height                   │
│   278 │   │   │   )                                                                              │
│   279                                                                                            │
│                                                                                                  │
│ ╭───────────────────────────── locals ─────────────────────────────╮                             │
│ │ self = <objexplore.objexplore.Explorer object at 0x7fe59d3d93d0> │                             │
│ ╰──────────────────────────────────────────────────────────────────╯                             │
│                                                                                                  │
│ /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages/objexplore/explorer_layo │
│ ut.py:188 in __call__                                                                            │
│                                                                                                  │
│   185 │   │   │   return self.list_layout(term_width, term_height)                               │
│   186 │   │                                                                                      │
│   187 │   │   else:                                                                              │
│ ❱ 188 │   │   │   return self.dir_layout(term_width)                                             │
│   189 │                                                                                          │
│   190 │   def dir_layout(self, term_width: int) -> Layout:                                       │
│   191 │   │   lines = []                                                                         │
│                                                                                                  │
│ ╭──────────── locals ────────────╮                                                               │
│ │        self = ExplorerLayout() │                                                               │
│ │ term_height = 36               │                                                               │
│ │  term_width = 120              │                                                               │
│ ╰────────────────────────────────╯                                                               │
│                                                                                                  │
│ /Users/rhet/.pyenv/versions/osxphotos-3.9.5/lib/python3.9/site-packages/objexplore/explorer_layo │
│ ut.py:228 in dir_layout                                                                          │
│                                                                                                  │
│   225 │   │   │   title = title.split("|")[-1].strip()                                           │
│   226 │   │                                                                                      │
│   227 │   │   self.update(                                                                       │
│ ❱ 228 │   │   │   Panel(                                                                         │
│   229 │   │   │   │   renderable,                                                                │
│   230 │   │   │   │   title=title,                                                               │
│   231 │   │   │   │   title_align="right",                                                       │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      _line = <text 'width' []>                                                               │ │
│ │      index = 87                                                                              │ │
│ │       line = <text 'width' []>                                                               │ │
│ │      lines = [                                                                               │ │
│ │              │   <text 'ExifInfo' []>,                                                       │ │
│ │              │   <text 'ExportResults' []>,                                                  │ │
│ │              │   <text 'ScoreInfo' []>,                                                      │ │
│ │              │   <text 'SearchInfo' []>,                                                     │ │
│ │              │   <text 'adjustments' []>,                                                    │ │
│ │              │   <text 'album_info' []>,                                                     │ │
│ │              │   <text 'albums' []>,                                                         │ │
│ │              │   <text 'asdict' []>,                                                         │ │
│ │              │   <text 'burst' []>,                                                          │ │
│ │              │   <text 'burst_album_info' []>,                                               │ │
│ │              │   ... +78                                                                     │ │
│ │              ]                                                                               │ │
│ │ renderable = <text                                                                           │ │
│ │              'ExifInfo\nExportResults\nScoreInfo\nSearchInfo\nadjustments\nalbum_info\nalbu… │ │
│ │              [Span(0, 8, 'dim italic reverse'), Span(9, 22, 'dim italic'), Span(23, 32, 'dim │ │
│ │              italic'), Span(33, 43, 'dim italic'), Span(74, 80, 'dim italic'), Span(238,     │ │
│ │              251, 'dim italic'), Span(282, 288, 'dim italic'), Span(289, 296, 'dim italic'), │ │
│ │              Span(465, 469, 'dim italic'), Span(769, 784, 'dim italic')]>                    │ │
│ │       self = ExplorerLayout()                                                                │ │
│ │   subtitle = '[dim][u][][/u]:switch pane                                                     │ │
│ │              [/dim][white]([/white][magenta]1[/magenta][white]/[/w'+34                       │ │
│ │ term_width = 120                                                                             │ │
│ │      title = '[i][cyan]dir[/cyan]()[/i] | [u]public[/u] [dim]private[/dim]'                  │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: __init__() got an unexpected keyword argument 'subtitle'

Uh oh... Foiled again!
Please report the issue here:
   https://github.com/kylepollina/objexplore/issues/new?assignees=&labels=&template=bug_report.md&title=__init__()+got+a
n+unexpected+keyword+argument+'subtitle'
Make sure to copy/paste the above traceback to the issue to make the issue quicker to solve!

Expected behavior
setup.py would specify the correct version of rich so that pip will fetch it.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants