tmurph / todo-sync Goto Github PK
View Code? Open in Web Editor NEWSync Emacs Org mode with Asana
License: GNU General Public License v3.0
Sync Emacs Org mode with Asana
License: GNU General Public License v3.0
@tmurph thanks for developing this tool. Are you still maintaining this repo? It looks like the Asana API changed so that expects 'gid' instead of 'id', so I hit this error when I try to use it:
$ todo-sync -v org ~/.emacs.d/init-todo-sync.el asana ASANA_TOKEN
Get From Source:
(ts-init)
Send To Source:
(ts-final)
Traceback (most recent call last):
File "/home/pdblood/.local/bin/todo-sync", line 8, in <module>
sys.exit(main())
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/command_line.py", line 48, in main
with module.ahead_source(
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/mappers/org_to_asana.py", line 67, in ahead_source
source = a.Source.from_client(client, verbose)
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/backends/asana.py", line 298, in from_client
c = cls(asana_client.users.me()['workspaces'][0]['id'],
KeyError: 'id'
If I change all the instances of 'id' to 'gid' in asana.py, it gets past this error, but then hits another one:
Send To Source:
(ts-final)
Traceback (most recent call last):
File "/home/pdblood/.local/bin/todo-sync", line 8, in <module>
sys.exit(main())
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/command_line.py", line 51, in main
edit_script(b_source.get_tree(), a_source.get_tree(),
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/backends/asana.py", line 403, in get_all_items
node = self.make_task_node(task)
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/backends/asana.py", line 328, in make_task_node
return TaskNode.from_dict(
File "/home/pdblood/.local/lib/python3.8/site-packages/todo_sync/node.py", line 17, in from_dict
raise Exception('All Nodes must have an ID.'
Exception: All Nodes must have an ID.
{'id': None} is reserved for Root nodes.
I suspect it's a related issue, but in case I've broken something else with my quick attempt at fixing it, I figured I'd report it in case you're still interested in updating your code.
Every time I try to connect and pull down tasks from Asana I receive the following error:
$ todo-sync org ~/tmp/asana-test/config.el asana $ASANA_TOKEN
Traceback (most recent call last):
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/expect.py", line 111, in expect_loop
incoming = spawn.read_nonblocking(spawn.maxread, timeout)
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking
return super(spawn, self).read_nonblocking(size)
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/spawnbase.py", line 176, in read_nonblocking
raise EOF('End Of File (EOF). Empty string style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/user1/anaconda3/bin/todo-sync", line 10, in <module>
sys.exit(main())
File "/Users/user1/anaconda3/lib/python3.6/site-packages/todo_sync/command_line.py", line 47, in main
args.behind_config, args.verbose, args.dry_run) as b_source:
File "/Users/user1/anaconda3/lib/python3.6/site-packages/todo_sync/mappers/org_to_asana.py", line 48, in behind_source
spawn, "Lisp expression: ", None)
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/replwrap.py", line 55, in __init__
self._expect_prompt()
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/replwrap.py", line 66, in _expect_prompt
timeout=timeout)
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/spawnbase.py", line 418, in expect_exact
return exp.expect_loop(timeout)
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/expect.py", line 117, in expect_loop
return self.eof(e)
File "/Users/user1/anaconda3/lib/python3.6/site-packages/pexpect/expect.py", line 63, in eof
raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.
<pexpect.pty_spawn.spawn object at 0x100eaa898>
command: /usr/local/bin/emacs
args: [b'/usr/local/bin/emacs', b'-batch', b'-l', b'/Users/user1/tmp/asana-test/config.el', b'-l', b'ts-org-interaction.el', b'--eval=(ts-repl)']
buffer (last 100 chars): ''
before (last 100 chars): '0.50/lisp/url" "/usr/local/Cellar/emacs-plus/HEAD-d2d4916/share/emacs/27.0.50/lisp/textmodes" ...)\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 83866
child_fd: 7
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_string:
0: 'Lisp expression: '
1: '[PEXPECT_PROMPT+'
My org file is empty and my config file looks like:
;;; make the downloaded ts-org-interaction library available
(add-to-list load-path (expand-file-name "~/tmp/asana-test"))
;;; set Org agenda file variables
(defvar org-directory (expand-file-name "~/tmp/asana-test"))
(defvar org-agenda-files '("asana.org"))
I'm using python 3.6.8 on macos 10.13 with org-version 9.2.3.
Any idea what could be going wrong?
File "../local/lib/python2.7/site-packages/todo_sync/helpers.py", line 45 print(title, *args, *kwargs.items(), sep="\n ", end="\n\n")
It seems strange, thanks!
I'm getting errors while trying to sync to and from an asana account.
I'm not sure what's relevant so ill try to provide all I can
I'm on mac osx using
Python 3.7.0 and GNU Emacs 25.3.1
I've cloned both this repo, and org mode inside ~/.emacs.d/vendor
Ended up using org modes maint
branch instead of master (with master I got complaints of missing functions in todo-sync otherwise)
I created a minimal config
cat ~/.emacs.d/todo-sync-config.el
;;; we need the downloaded version of Org
(add-to-list 'load-path "~/.emacs.d/vendor/todo-sync/emacs")
(add-to-list 'load-path "~/.emacs.d/vendor/org-mode/lisp")
;;; and we need to set Org agenda files
(defvar org-directory (expand-file-name "~/notes"))
(defvar org-agenda-files '("asanaTasks.org"))
also created a script for pushing tasks
cat push-home-tasks
#!/bin/bash
asanaToken=***
initFile="~/.emacs.d/todo-sync-config.el"
todo-sync asana $asanaToken org $initFile -v
However it throws a generator raised StopIteration
Get From Source:
(ts-init)
Tag Find by Workspace:
796042258360695
Send To Source:
(ts-final)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/asana/page_iterator.py", line 61, in items
raise StopIteration
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/todo-sync", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/todo_sync/command_line.py", line 51, in main
edit_script(b_source.get_tree(), a_source.get_tree(),
File "/usr/local/lib/python3.7/site-packages/todo_sync/backends/asana.py", line 345, in get_all_items
for tag in all_tags:
RuntimeError: generator raised StopIteration
Interestingly it actually edits the task file with properties
cat asanaTasks.org
* funtimes
:PROPERTIES:
:ID: 688076AD-1A48-4DE1-9F92-F8AED2659BC6
:END:
- a note
When trying to retrieve tasks I also get an error
cat retrieve-home-tasks
#!/bin/bash
asanaToken=****
initFile="~/.emacs.d/todo-sync-config.el"
todo-sync org $initFile asana $asanaToken -v
Get From Source:
(ts-init)
Get From Source:
(ts-get-all-headlines '(:id :title :paragraph :parent-id :todo-type :closed :deadline :filename :tags :asana_id :asana_project_id))
Send To Source:
(ts-final)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 111, in expect_loop
incoming = spawn.read_nonblocking(spawn.maxread, timeout)
File "/usr/local/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking
return super(spawn, self).read_nonblocking(size)
File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 176, in read_nonblocking
raise EOF('End Of File (EOF). Empty string style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/todo_sync/command_line.py", line 51, in main
edit_script(b_source.get_tree(), a_source.get_tree(),
File "/usr/local/lib/python3.7/site-packages/todo_sync/mappers/org_to_asana.py", line 59, in <lambda>
['asana_id', 'asana_project_id'])
File "/usr/local/lib/python3.7/site-packages/todo_sync/backends/org.py", line 245, in get_all_items
elisp_string_from_list(field_list)))
File "/usr/local/lib/python3.7/site-packages/todo_sync/helpers.py", line 46, in wrapped_fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pexpect/replwrap.py", line 95, in run_command
if self._expect_prompt(timeout=timeout) == 1:
File "/usr/local/lib/python3.7/site-packages/pexpect/replwrap.py", line 66, in _expect_prompt
timeout=timeout)
File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 418, in expect_exact
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 117, in expect_loop
return self.eof(e)
File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 63, in eof
raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.
<pexpect.pty_spawn.spawn object at 0x1027ebc88>
command: /usr/local/bin/emacs
args: [b'/usr/local/bin/emacs', b'-batch', b'-l', b'~/.emacs.d/todo-sync-config.el', b'-l', b'ts-org-interaction.el', b'--eval=(ts-repl)']
buffer (last 100 chars): ''
before (last 100 chars): 'Args out of range: "", 2, nil\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 24682
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_string:
0: 'Lisp expression: '
1: '[PEXPECT_PROMPT+'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/todo-sync", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/todo_sync/command_line.py", line 53, in main
args.no_delete)
File "/usr/local/lib/python3.7/site-packages/todo_sync/backends/org.py", line 211, in __exit__
self._repl_to_source_command('(ts-final)')
File "/usr/local/lib/python3.7/site-packages/todo_sync/helpers.py", line 46, in wrapped_fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pexpect/replwrap.py", line 88, in run_command
self.child.sendline(cmdlines[0])
File "/usr/local/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 555, in sendline
return self.send(s + self.linesep)
File "/usr/local/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 546, in send
return os.write(self.child_fd, b)
OSError: [Errno 5] Input/output error
Is there something silly I'm missing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.