GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
148 stars 28 forks source link

add: native Windows support. #62

Closed xarthurx closed 5 years ago

xarthurx commented 5 years ago

for applications that exist in native Windows python, run wsl TaskWarrior command from native Windows cmd will work.

robgolding commented 5 years ago

Hey @xarthurx thanks so much for the PR!

I wonder if we could achieve this in a more generic way through a new parameter to the TaskWarrior class? For example TaskWarrior(taskwarrior_command='wsl TaskWarrior').

That way we can support other platforms or even folks who have task installed in a non-standard location.

What do you think?

xarthurx commented 5 years ago

@robgolding Hey, thanks for the reply. About your question, what do you mean by "non-standard location"? do you mean virtual environment?

From my perspective, since TaskWarrior is almost universal supported across unix based system, there seems to be no need for that.

And for the WSL part, it is not a programme-specific problem, but more a platform issue. So even make the command as wsl TaskWarrior, you still need to use wsl task, etc, for calling command in WSL from native Windows.

I personally prefer the flag way, in which the difference for users is just activating the different platform. (WSL or Linux).

But of course if you have more user-case in mind, there definitely will be better ways to get more general support.

robgolding commented 5 years ago

Hey @xarthurx! I mean the task binary location (e.g. if it's located at /opt/taskwarrior/bin/task or something). I'll work up an alternative PR which maybe you could test out on WSL?

xarthurx commented 5 years ago

Sure, I'm glad to do it~

On Mon, 6 May 2019 at 16:46, Rob Golding notifications@github.com wrote:

Hey @xarthurx https://github.com/xarthurx! I mean the task binary location (e.g. if it's located at /opt/taskwarrior/bin/task or something). I'll work up an alternative PR which maybe you could test out on WSL?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robgolding/tasklib/pull/62#issuecomment-489647730, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOVGVUMYD2KDNTMY7TIX3LPUBACPANCNFSM4HKMOWQQ .

-- MA Zhao

"SAVE PAPER - PLEASE THINK BEFORE YOU PRINT!"

xarthurx commented 5 years ago

Hi @robgolding, I test your PR https://github.com/robgolding/tasklib/pull/63 and it works great with the custom task_command. However, an issue exist if rc file override is used: (this is the default behaviour if .taskrc is placed inside windows user's home dir. -- tasklib will interprets the ~/.taskrc and automatically call the override func)

Based on this: https://taskwarrior.org/docs/configuration.html

= should be used instead of the original : in the lib. (it gives errors)

As I cannot add things to your PR, I appended it here. Please feel free to use this PR or edit your PR, either works for me.

And please let me know if you have other questions.

robgolding commented 5 years ago

Thanks @xarthurx! I wonder if they use a different symbol on Unix vs Windows, because it's definitely always worked with a colon before 😅 . E.g.:

$ task rc:/
Using alternate .taskrc file /
[task next rc:/]
No matches.

However with =, I get:

$ task rc=/
[task next rc=/]

ID Age  Tag         Description                            Urg
...

One thing we can do instead, though, is use the TASKRC environment variable, which should work regardless of the platform. I'll update my PR with that so you can give it a try!

robgolding commented 5 years ago

Superseded by #63