Nanoseb / ncTelegram

A ncurse Telegram client developed in Python
GNU General Public License v3.0
311 stars 26 forks source link

Can't Set Focus, ListBox Is Empty #39

Closed weilbith closed 6 years ago

weilbith commented 6 years ago

After successfuly initialize telegram-cli and trying to start nctelegram now, lead to the following error message:

bind: Address already in use
Traceback (most recent call last):
  File "/usr/bin/nctelegram", line 93, in <module>
    ncTelegram.Telegram_ui(config_full)
  File "/usr/lib/python3.7/site-packages/ncTelegram/__init__.py", line 73, in __init__
    self.msg_widget = MessageWidget(self)
  File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 25, in __init__
    self.get_history()
  File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 66, in get_history
    self.draw_separator()
  File "/usr/lib/python3.7/site-packages/ncTelegram/ui_msgwidget.py", line 246, in draw_separator
    self.focus_position = self.separator_pos
  File "/usr/lib/python3.7/site-packages/urwid/listbox.py", line 578, in set_focus
    raise IndexError("Can't set focus, ListBox is empty")
IndexError: Can't set focus, ListBox is empty

I've installed it through the ArchLinux user repository.

Nanoseb commented 6 years ago

Have you ever used telegram before? I think the reason you have this error is because there is no conversation or no messages. You cannot create new discussion in nctelegram, so if you have never used telegram before you won't be able to use nctelegram. If the error doesn't comes from this, then I don't know what is wrong

weilbith commented 6 years ago

Definitely yes. I've already used it and interacting with telegram-cli directly seems works fine.

jonaburg commented 6 years ago

I have the same issue. Have used both telegram-desktop and telegram-cli successfully

jonaburg commented 6 years ago

In particular, this happens only with urwid 2.0. Downgrading 2.0 to 1.3 yields "module urwid cannot be found".

Mikepicker commented 6 years ago

I created a pull request which fixes this issue, it is referenced here: #40 Please, test it and let me know if it works for you.

Nanoseb commented 6 years ago

Thanks again @Mikepicker ! closing this now, it seems to work for everyone