taskwiki icon indicating copy to clipboard operation
taskwiki copied to clipboard

Cannot get taskwikigrid to work even though vim-taskwarrior is installed

Open arooni opened this issue 8 years ago • 9 comments

running :TaskWikiGrid

 "task next report" 0L, 0C Error detected while processing : Traceback (most recent call last): File "", line 1, in File "/home/david/.vim/plugged/taskwiki/taskwiki/errors.py", line 26, in wrapped_function original_function(*args, **kwargs) File "/home/david/.vim/plugged/taskwiki/taskwiki/main.py", line 145, in grid .format(port.tw.taskrc_location, port.raw_filter)) vim.error: Vim(let):E484: Can't open file /home/david/tmp/v0odqzz/8

relevant .vimrc stuff: set swapfile set dir=~/tmp let $TMPDIR = $HOME."/tmp" set shell=/bin/bash

I'm using fish shell if it matters, on ubuntu 16.04

arooni avatar May 20 '17 01:05 arooni

Does vim-taskwarrior work when you use it directly?

tbabej avatar May 20 '17 09:05 tbabej

Yes sir. Not sure what report your grid function is calling in vim-taskwarrior but the default :TW pulls up a grid of sorts and works just fine.

arooni avatar May 20 '17 16:05 arooni

Taskwiki calls: TW rc:/path/to/.taskrc rc.context: , see the source code.

tbabej avatar May 20 '17 16:05 tbabej

@arooni Did you resolve this issue in the end?

tbabej avatar Jul 31 '17 15:07 tbabej

I'm also seeing this. I modified the grid function to show me variables like so:

        if port:
            print("rc:", port.tw.taskrc_location)
            print("filter:", port.raw_filter)
            print("command:", "TW rc:{0} rc.context: {1}"
                        .format(port.tw.taskrc_location, port.raw_filter))
            vim.command("TW rc:{0} rc.context: {1}"
                        .format(port.tw.taskrc_location, port.raw_filter))
        else:

And after a :TaskWikiGrid i see:

rc: /Users/sophacles/.taskrc
filter: -DELETED -PARENT ( project:columbia_st )
command: TW rc:/Users/sophacles/.taskrc rc.context: -DELETED -PARENT ( project:columbia_st )
Error detected while processing :
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/sophacles/.vim/bundle/taskwiki/taskwiki/errors.py", line 26, in wrapped_function
    original_function(*args, **kwargs)
  File "/Users/sophacles/.vim/bundle/taskwiki/taskwiki/main.py", line 157, in grid
    .format(port.tw.taskrc_location, port.raw_filter))
vim.error: Vim(let):E484: Can't open file /var/folders/9j/4pr6_hf111gcyjjr60z_vls00000gn/T/vhejUp7/5

When I manually run:

 :TW rc:/Users/sophacles/.taskrc rc.context: -DELETED -PARENT ( project:columbia_st )

I get the same Vim error about missing files. But when I manually run:

 :TW rc:/Users/sophacles/.taskrc 'rc.context: -DELETED -PARENT ( project:columbia_st )'

I get the grid.

Changing line 152 of main.py to:

            vim.command("TW rc:{0} 'rc.context: {1}'"
                        .format(port.tw.taskrc_location, port.raw_filter))

Fixes :TaskWikiGrid for this situation.

sophacles avatar Sep 06 '17 15:09 sophacles

Update: my fix only partially works... it stops the error, but doesn't filter the rc.context: portion correctly. The problem seems to be with the ( and ). If i change the grid function to look like this:

        if port:
            vim.command("TW rc:{0} rc.context: {1}"
                        .format(port.tw.taskrc_location, port.raw_filter).replace('(', '').replace(")", ""))

The filter is correctly applied.

sophacles avatar Sep 06 '17 15:09 sophacles

I can confirm both the issue and this fix.

do0g avatar Sep 12 '17 19:09 do0g

@sophacles @do0g What about converting this into a pull request?

tbabej avatar Jul 15 '18 23:07 tbabej

Just started using this app again; would love to have this part of the app working

arooni avatar Dec 13 '19 21:12 arooni