Xapers

Jameson Graef Rollins jrollins at finestructure.net
Mon Apr 15 12:07:25 PDT 2013


On Mon, Apr 15 2013, Patrick Totzke <patricktotzke at gmail.com> wrote:
> Brilliant idea!

Thanks!  I give Carl all the credit, though, since it's really all just
based on the notmuch idea.

> here's some early feedback:
> * is there a way to batch import a bunch of pdfs? or better yet, a bibtex file with entries pointing
>   to files like the ones produced by say jabref?
>   There, entries have some line like this:
>   file = {Boz2012.pdf:papers/Boz2012.pdf:PDF}

There's not currently a prescribed way to batch import, but if you can
programmatically get all pdf/bibtex pairs then it should be easy to
script:

  xapers import --file=PDF --source=BIBTEX

> * got a bunch of traces:
>   -----------------------------
>   $xapers import --source=ABK2011.pdf                                                                                     1 ↵ master 
>   Reading bibtex... done.
>   Adding bibtex... 
>   
>   Traceback (most recent call last):
>     File "/home/pazz/.local/bin/xapers", line 145, in <module>
>       docid = cli.add(query_string, infile=infile, source=source, tags=tags, prompt=prompt)
>     File "/home/pazz/.local/lib/python2.7/site-packages/xapers/cli/ui.py", line 228, in add
>       doc.add_bibtex(bibtex)
>     File "/home/pazz/.local/lib/python2.7/site-packages/xapers/documents.py", line 373, in add_bibtex
>       self.bibentry = xapers.bibtex.Bibentry(bibtex)
>     File "/home/pazz/.local/lib/python2.7/site-packages/xapers/bibtex.py", line 25, in __init__
>       if os.path.exists(bibtex):
>     File "/usr/lib/python2.7/genericpath.py", line 18, in exists
>       os.stat(path)
>   TypeError: must be encoded string without NULL bytes, not str
>   ----------------------------

Yikes.  Sorry about that.  Clearly more error checking is needed.

The problem here is that PDFs should passed in through the --file=
option, while source library URLs or bibtex files should be passed in
through --source=.

>   $ xapers show, then i moved around a bit
>
>   ----------------------------
>   Traceback (most recent call last):
>     File "/home/pazz/.local/bin/xapers", line 228, in <module>
>       xapers.nci.UI(xroot, cmd=args)
>     File "/home/pazz/.local/lib/python2.7/site-packages/xapers/nci/ui.py", line 73, in __init__
>       self.mainloop.run()
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 272, in run
>       self.screen.run_wrapper(self._run)
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/raw_display.py", line 242, in run_wrapper
>       return fn()
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 337, in _run
>       self.event_loop.run()
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 708, in run
>       self._loop()
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 787, in _loop
>       self._watch_files[fd]()
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 388, in _update
>       self.process_input(keys)
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 488, in process_input
>       k = self._topmost_widget.keypress(self.screen_size, k)
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/container.py", line 1120, in keypress
>       return self.body.keypress( (maxcol, remaining), key )
>     File "/home/pazz/.local/lib/python2.7/site-packages/xapers/nci/search.py", line 304, in keypress
>       eval(cmd)
>     File "<string>", line 1, in <module>
>     File "/home/pazz/.local/lib/python2.7/site-packages/xapers/nci/search.py", line 155, in nextEntry
>       self.listbox.set_focus(pos + 1)
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 567, in set_focus
>       self.body.set_focus(position)
>     File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 178, in set_focus
>       raise IndexError, "No widget at position %s" % (position,)
>   IndexError: No widget at position 1
>   ----------------------------

Hrm.  Don't know what this is about.  I'll look into it.  Sorry again!

> * did you already set something up to report bugs? github issues, a maling list?

No, not yet.  I wanted to gauge interest first.  Maybe I'll go ahead and
set something up on github.  In the meantime please just report bugs to
be directly and I'll note them in the TODO.

> Can't wait until someone forks alot to use this. I've been waiting for
> someone (else) to start a project like this for some time now :)

Well actually the curses UI is ripped almost entirely from alot already!
It clearly needs some more work, though.

Thanks for the feedback and interest!

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20130415/a69a02ab/attachment.pgp>


More information about the notmuch mailing list