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

Deleting an item within a filtered list raised IndexError #46

Open
doron-cohen opened this issue Jul 17, 2017 · 0 comments
Open

Deleting an item within a filtered list raised IndexError #46

doron-cohen opened this issue Jul 17, 2017 · 0 comments

Comments

@doron-cohen
Copy link

doron-cohen commented Jul 17, 2017

I have the following todo list:

(A) Bla bla bla bla bla bla @fufuf +zirpat
(A) Bla bla bla bla bla bla @fufuf +wednesdayreport +zirpat
(A) Bla bla bla bla bla bla @work
(A) Bla bla bla bla bla bla +zirpat @fufuf
(A) Bla bla bla bla bla bla @fufuf
(A) Bla bla bla bla bla bla +gamermool @web
(A) Bla bla bla bla bla bla +gamermool @web
(A) Bla bla bla bla bla bla @fufuf +zirpat
(B) Bla bla bla bla bla bla +zemzem @web
(B) Bla bla bla bla bla bla @web @phone +gamermool
(B) Bla bla bla bla bla bla +gamermool @email @web
(B) Bla bla bla bla bla bla @fufuf @home +ziva
(B) Bla bla bla bla bla bla @work +gargafd
(B) Bla bla bla bla bla bla +gamermool @web
(B) Bla bla bla bla bla bla +igaltrade @web
(B) Bla bla bla bla bla bla @work +gulgal
(B) Bla bla bla bla bla bla @fufuf +rice
(B) Bla bla bla bla bla bla @work +gargafd
(B) Bla bla bla bla bla bla @work +gargafd
(B) Bla bla bla bla bla bla @web +gamermool
(B) Bla bla bla bla bla bla @email +ziva
(B) Bla bla bla bla bla bla +zemzem @web
(B) Bla bla bla bla bla bla @web +rice
(B) Bla bla bla bla bla bla @home +zirpat
(B) Bla bla bla bla bla bla +igaltrade @fufuf
(B) Bla bla bla bla bla bla @work +gargafd
(C) Bla bla bla bla bla bla +zirpat @fufuf
(C) Bla bla bla bla bla bla @fufuf +zirpat
(C) Bla bla bla bla bla bla @fufuf +zirpat
(C) Bla bla bla bla bla bla @fufuf +zirpat
(D) Bla bla bla bla bla bla @fufuf +zirpat
(D) Bla bla bla bla bla bla @work +gulgal
(D) Bla bla bla bla bla bla @fufuf +zirpat
(D) Bla bla bla bla bla bla @work
(E) Bla bla bla bla bla bla @home +paperless
(E) Bla bla bla bla bla bla @fufuf +side
(E) Bla bla bla bla bla bla @fufuf +rice
(E) Bla bla bla bla bla bla @home +paperless
(E) Bla bla bla bla bla bla @home +gamermool
x 2017-06-29 (B) Bla bla bla bla @work +gulgal
x 2017-07-01 (B) Bla bla bla bla @home +vacation
x 2017-07-02 (A) Bla bla bla bla +zirpat @phone
x 2017-07-02 (A) Bla bla bla bla @work +gargafd
x 2017-07-02 (B) Bla bla bla bla +zirpat @fufuf
x 2017-07-03 (B) Bla bla bla bla @work +gargafd
x 2017-07-03 (C) Bla bla bla bla +gulgal @work
x 2017-07-04 (C) Bla bla bla bla @work
x 2017-07-05 (A) Bla bla bla bla +zirpat +wednesdayreport @fufuf
x 2017-07-06 (A) Bla bla bla bla +zirpat @fufuf
x 2017-07-06 (B) Bla bla bla bla @work +gulgal
x 2017-07-06 (B) Bla bla bla bla @work +gargafd
x 2017-07-06 (B) Bla bla bla bla @work +gargafd
x 2017-07-06 (D) Bla bla bla bla @work +gargafd
x 2017-07-09 (A) Bla bla bla bla @work +gargafd
x 2017-07-11 (A) Bla bla bla bla @work +gargafd
x 2017-07-11 (B) Bla bla bla bla @fufuf +zirpat
x 2017-07-13 (A) Bla bla bla bla @work +gargafd
(B) Trying to delete this one @work

I filter on @work and try to delete (B) Trying to delete this one @workand I get:

  File "/home/doronc/.virtualenvs/todotxt/bin/todotxt-machine", line 11, in <module>
    sys.exit(main())
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/todotxt_machine/cli.py", line 129, in main
    view.main()
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/todotxt_machine/urwid_ui.py", line 944, in main
    self.loop.run()
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 278, in run
    self._run()
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 376, in _run
    self.event_loop.run()
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 682, in run
    self._loop()
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 719, in _loop
    self._watch_files[fd]()
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/raw_display.py", line 393, in <lambda>
    event_loop, callback, self.get_available_raw_input())
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/raw_display.py", line 493, in parse_input
    callback(processed, processed_codes)
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 403, in _update
    self.process_input(keys)
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 509, in process_input
    something_handled |= bool(self.unhandled_input(k))
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/urwid/main_loop.py", line 555, in unhandled_input
    return self._unhandled_input(input)
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/todotxt_machine/urwid_ui.py", line 528, in keystroke
    self.todos.delete(i)
  File "/home/doronc/.virtualenvs/todotxt/lib/python3.5/site-packages/todotxt_machine/todo.py", line 173, in delete
    del self.todo_items[index]
IndexError: list assignment index out of range

😢

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

1 participant