34 Commits

Author SHA1 Message Date
Bill Flynn
aea58dea29 [] refactored exception into standardize_doi 2018-01-05 21:31:19 -05:00
Bill Flynn
e2ad39ca08 [Fix ] robust handling of DOIs
Added DOI regex function to utils.py which is called in add_cmd.py
upon specifying a new DOI.  DOI validation applies directly on
argument parsing by using a custom argparse.Action.
2018-01-05 19:22:00 -05:00
Olivier Mangin
02c11aaaea Adds completion for citekeys. 2017-07-08 00:10:15 -04:00
Fabien Benureau
e5b898c5c2 Cache implemented
The implementation is designed to be robust to filesystems having integers
or nanosecond stat time.

Added a requirements.txt file for the tests:
`pip install -r tests/requirements.txt` to install the necessary packages
to run the tests.

Fix , Fix 
2016-01-23 02:03:02 +01:00
Olivier Mangin
ed2bbb4498 Removes generic handling of errors from commands.
The default behavior for commands is now to only catch exceptions that
must be handled specifically. This includes outputting a context
dependant message, cleaning up, etc. All other exceptions will be
handled by the ui.
2016-01-15 19:02:56 -05:00
Fabien Benureau
b6e8139bc3 Remove extraneous doc message 2015-12-20 22:22:11 +01:00
Olivier Mangin
854702488c Fixes : editor command behaviors with the new config.
- Fix the previous default to 'None' (the string 'None', not None)
in the config.
- Adds support for using the $EDITOR when none is defined in the condif.
- Use ui.editor instead of content.editor in the add commnand.
2015-12-16 15:45:45 -05:00
Fabien Benureau
f843aebcbd Better handle utf-8 citekeys
Utf-8 citekeys generate errors in bibtexparser. Until this is fixed,
this commit replace the stack-trace by a clear error message.

related: 
2015-12-16 16:38:40 +01:00
Fabien Benureau
93c54939b3 Rewritten config module
It depends on configobj, is cleaner and simpler than the previous implementation.
It adds comments in the config file, and type verification.

Related: 
2015-12-04 20:49:05 +01:00
Fabien Benureau
4b3b2a23bd Improves interface of PrintUI
`print_out()` is replaced by `message()`, that redirect the output to
the stdout controlled by the PrintUI instance. Other than that, can be
used the same way as `print()`.
2015-12-03 16:09:54 +01:00
Fabien Benureau
cce9406670 new print ui, more robust colors 2015-12-02 16:36:27 +01:00
Fabien Benureau
8afb7a4777 Merge remote-tracking branch 'refs/remotes/origin/master' 2015-12-02 06:39:27 +01:00
Olivier Mangin
67aac0a2d7 Adds move option to add and attach commands.
When set removes original document file after copy.
2015-05-07 13:55:08 +02:00
Olivier Mangin
de2a50eeb2 Fix tests and terminology.
First this brings a change to the paper API: the terminology of bibdata
and bibentry is clarified: now bibentry is a dictionary of the form
{citekey: bibdata} where bibdata corresponds to the actual dictionary of
bibliographic fields and values {author: ..., year: ...}.
Now bibentry is an attribute of the paper object that is generated from
citekey and bibdata.

This commit fixes all tests in particular an issue with citekey in
bibentry not updated.

Also removes prints in tests and deprecated assertEquals.

Usecase tests now fail if the command ask for unexpected inputs.

Removes queries for user input in attach and add commands (for deletion
of a copied document file). The input was not coherent with tests and is
annoying.
2015-05-07 13:17:44 +02:00
Fabien Benureau
3aa64d4cd2 minor dialog update 2015-04-15 16:52:10 +02:00
Fabien Benureau
526dc6418f updated add cmds with isbn support, improved dialog, replaced -c and -C by single --link option 2015-01-24 01:01:31 +01:00
Fabien Benureau
27a3058bee improved dialogs 2015-01-23 16:47:50 +01:00
Fabien Benureau
2cabdf4703 add dialog to delete the original docfile if copied 2015-01-22 04:08:35 +01:00
Fabien Benureau
97a0d15ca2 fix graceful exit when DOI is not recognized 2015-01-20 11:06:52 +01:00
Fabien Benureau
adb0158c3d experimental support for adding from DOIs 2015-01-08 14:58:41 +01:00
Olivier Mangin
89bf370902 Fails to add with existing citekey.
Also adds add usecase test and improves repository __contains__.
2014-04-28 20:08:05 +02:00
Olivier Mangin
39b2e4f912 Factorizes code for adding document.
- Document are added through repository method.
- Correct handling of the copy option.
- Does not check if document exists yet.
- Does not bypass copy=False if an url is given. Should it?
- Currently the document is actually pushed twice (not optimal).
2014-04-28 19:45:06 +02:00
Olivier Mangin
53a0f0a86e Fixes path conversion for add_doc.
Note: in current state the non-copy addition of document is not
implemented. This commit also adds the raise of a NotImplementedError if
the behavior is requested.
2014-04-28 18:20:45 +02:00
Olivier Mangin
c45b64506a Merge branch 'develop' into feat/python3 2014-04-19 22:18:51 +02:00
Fabien Benureau
071730a49b fix and achieve method parity between databroker and datacache 2014-04-19 21:11:02 +02:00
Olivier Mangin
01fd368c97 Fix import and except syntax for python3. 2014-04-19 16:56:31 +02:00
Olivier Mangin
ed16f0bb5b Fix undefined variable and remove 'added' time (set by repo.push_paper). 2014-04-19 16:55:37 +02:00
Olivier Mangin
07cb6f696c Adds back edit command.
The Repository rename_paper method has been updated. The citekey update
and syncronization with citekey in the bibdata should be handled in a
sane manner inside the Paper class.
2014-04-16 18:47:14 +02:00
Fabien Benureau
d3736e257b moving from pybtex to bibtextparser, fixed major regressions.
* only bibtex format is supported
* all tests except test_repo.py and edit test pass
* edit and update commands were not updated
* removed --format argument from export, only bibtex is supported.
2014-04-13 15:10:40 +02:00
Fabien Benureau
523fe888a3 many bugfixes when adding paper through editor 2013-11-18 21:03:47 +01:00
Fabien Benureau
dbb17426d0 add_cmd: fix bug 2013-11-17 17:41:22 +01:00
Fabien Benureau
529e4e5950 added timestamps 2013-11-17 00:25:33 +01:00
Fabien Benureau
c4f296346a add template text to add editor input 2013-11-15 13:25:54 +01:00
Fabien Benureau
8d91545472 papers renamed 'pubs' 2013-11-14 04:40:29 +01:00