Open felipesere opened 10 years ago
I started implementing this functionality, since I need it to be able to sync my todo.txt over multiple devices but want to keep the terminal with todotxt-machine open. Find the code here: ad28e62db994f3dcfc158093c5fc5496df11b8f8
There are however a few things that need to be discussed. First of all, how to handle the case where you entered a new todo item within todotxt-machine but did not save it yet (e.g. because you forgot), and a new todo item is added from somewhere else. In my current implementation, all unsaved changes are lost, which obviously is not the way to go.
A possibility to overcome this would be to automatically save the todo.txt file after every change. IMHO, this shouldn't be a problem, but people have asked to be able to explicitly specify when todotxt-machine should write changes to disk (see Issue #6), so I don't know...
Any opinions?
I also started working on this :)
In my variation I use watchdog
to watch the filesystem.
Saving any modification straight to disk should be valid. It does not help if the file is also being manipulated by a remote client. Imagine having you file in dropbox. Once you phone syncs those changes into dropbox, conflicts should pop up. I would ignore "conflict resolution" for the time being.
I do think though that some refactoring is needed to make the code more manageable.
Great!
Using watchdog
, are you able to update the todo list without waiting for a keypress? That would be really great. The downside is of course that it introduces another dependency, but it might be worth it!
The sync problem you mentioned comes up regardless of which todo.txt manager you use when using simple cloud solutions like Dropbox. I don't see how one could solve it within the application. So, I agree, we should ignore it.
Yeah, watchdog is pretty neat. As far as I can tell, it is multi-platform. I'll see if I can push my branch into a fork some time this week.
Watchdog looks very cool, I'd be happy to merge a pull request with that functionality. I'm currently working on throwing away the screen.py file which is completely unmaintainable and using urwid for the ui.
I'm currently working on throwing away the screen.py file which is completely unmaintainable and using urwid for the ui.
I hope you keep the UI elements as they are. I really appreciate the UI.
I hope you keep the UI elements as they are. I really appreciate the UI.
I definitely want to keep the same ui appearance and feel.
Hi felipesere, I've implemented reloading/reverting a todo.txt file from disk on a keypress (not automatically) implemented in the urwid branch now. Not all the original functionality is in the urwid branch. Hopefully that will help with implementing autoreloading.
Hi, I wanted to use todotxt-machine as a view for my todo.txt. I'll be adding most of my todos from todo.txt-vim while keeping todotxt-machine open on a separate tab. Is it possible to make it refresh the list from the file?