Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open pdf attachments stored locally #17

Open
joelostblom opened this issue Feb 10, 2017 · 4 comments
Open

Open pdf attachments stored locally #17

joelostblom opened this issue Feb 10, 2017 · 4 comments

Comments

@joelostblom
Copy link
Contributor

joelostblom commented Feb 10, 2017

Can zotero-cli read pdf-attachments that are not stored on the zotero server? I am using zotfile to organize my pdf articles and I store them in a separate directory on the file system. Zotero stores a link pointing to the location of the pdf, would it be possible to resolve this link with zotero-cli in order to open the pdf?

This is the traceback I am receiving when trying to open a linked pdf-attachemnt with zotcli read <id>

Traceback (most recent call last):
  File "/home/joel/anaconda3/bin/zotcli", line 11, in <module>
    sys.exit(cli())
  File "/home/joel/anaconda3/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/joel/anaconda3/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/joel/anaconda3/lib/python3.5/site-packages/click/core.py", line 1066, ininvoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/joel/anaconda3/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/joel/anaconda3/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/joel/anaconda3/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/joel/anaconda3/lib/python3.5/site-packages/zotero_cli/cli.py", line 198,in read
    attachments = ctx.obj.attachments(item_id)
  File "/home/joel/anaconda3/lib/python3.5/site-packages/zotero_cli/backend.py", line 224, in attachments
    attachments = self._zot.children(item_id, itemType="attachment")
  File "/home/joel/anaconda3/lib/python3.5/site-packages/pyzotero/zotero.py", line 127, in wrapped_f
    retrieved = self._retrieve_data(func(self, *args))
  File "/home/joel/anaconda3/lib/python3.5/site-packages/pyzotero/zotero.py", line 557, in children
    i=item.upper())
AttributeError: 'NoneType' object has no attribute 'upper'
@DancingQuanta
Copy link
Contributor

The error handling is better now, saying that attachment is not stored on server.
HEAD have local storage and so need to add code that stores link to file in index.sqlite and use that to open locally stored pdf.

@kevintaylor
Copy link

+1 for this feature request.

2 similar comments
@jakub-kaminski
Copy link

+1 for this feature request.

@eomiso
Copy link

eomiso commented Oct 1, 2021

+1 for this feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants