AnthonyDiGirolamo / todotxt-machine

an interactive terminal based todo.txt file editor with an interface similar to mutt
https://pypi.python.org/pypi/todotxt-machine/
GNU General Public License v3.0
245 stars 37 forks source link

Could this be Linux only ? #1

Open sander76 opened 10 years ago

sander76 commented 10 years ago

Getting all kinds of import errors. Possibly because I am on Win7 ?

AnthonyDiGirolamo commented 10 years ago

Hey sander76, I'm actively developing it now on a Mac. It uses VT100 escape sequences and won't work in windows. Should work in Mac and Linux for now.

AnthonyDiGirolamo commented 10 years ago

screenshot1

Here is what it looks like currenty.

simonvanderveldt commented 9 years ago

@AnthonyDiGirolamo Small question: Is there anything that can be done about this? Really like todotxt-machine, but I still have 1 Windows machine :) There are VT100 compatible terminal emulators for Windows, so that shouldn't be the problem.

I've got it working in Cygwin, but that's quiet a huge workaround ;)

AnthonyDiGirolamo commented 9 years ago

I would like to get it working in windows. The UI library I'm using urwid works in windows I believe. What terminals would be easy to install for users?

simonvanderveldt commented 9 years ago

That's great!

I'm using cmder which is a good-looking and easy to install prepackaged version of ConEmu.

AnthonyDiGirolamo commented 9 years ago

I'll give it a shot!

simonvanderveldt commented 9 years ago

Cool! If you need some help let me know!

AnthonyDiGirolamo commented 9 years ago

So I gave it a try in windows7 with cmder but hit a road block with urwid.

C:\cygwin64\home\anthony\todotxt-machine
λ python todotxt-machine.py todobackup.txt
Traceback (most recent call last):
  File "todotxt-machine.py", line 5, in <module>
    todotxt_machine.cli.main()
  File "C:\cygwin64\home\anthony\todotxt-machine\todotxt_machine\cli.py", line 113, in main
    view.main()
  File "C:\cygwin64\home\anthony\todotxt-machine\todotxt_machine\urwid_ui.py", line 856, in main
    self.loop = urwid.MainLoop(self.view, self.palette, unhandled_input=self.keystroke)
  File "C:\Python27\lib\site-packages\urwid\main_loop.py", line 111, in __init__
    screen = raw_display.Screen()
  File "C:\Python27\lib\site-packages\urwid\raw_display.py", line 89, in __init__
    fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: global name 'fcntl' is not defined

The only thing I changed in my code is in terminal_operations.py

try:
    import tty
    import termios
    import fcntl
except:
    pass # windows

I don't think urwid supports windows like I thought. Despite the mention in the changelog

simonvanderveldt commented 9 years ago

Seems like there's nothing we can do :(

urwid itself supports both ncurses and raw display modules http://urwid.org/manual/displaymodules.html. I tried both:

I guess the mentioned support is for Windows using Cygwin.

Anyway, it was a nice exercise, but back to Cygwin it is :) Thx for trying!

AnthonyDiGirolamo commented 9 years ago

No problem, thanks for trying as well. Before switching to urwid I had a raw escape sequence GUI implementation. It only used termios to set raw output and get the screen size but those might be rewritten to work on windows better. The UI isn't as functional as the urwid. Here is the code: https://github.com/AnthonyDiGirolamo/todotxt-machine/blob/1.1.8/todotxt_machine/screen.py

AnthonyDiGirolamo commented 9 years ago

Would it be possible to package a standalone cygwin installer that includes python and pip?