329 Commits

Author SHA1 Message Date
ksunden
247554c248 Fix error handling 2018-05-08 23:20:32 -05:00
ksunden
bff1f5763d Add a command to open urls 2018-05-08 22:32:12 -05:00
Fabien C. Y. Benureau
913a5d77b5 unicode citekey in python2; removes 2018-04-10 14:55:55 +09:00
Fabien C. Y. Benureau
c7e9470300 implement requested changes for #133 2018-04-10 14:46:27 +09:00
Fabien C. Y. Benureau
dc4e118c3c make utf8 citekeys possible in python 2.7. closes #28
This involved many changes, some side effects of the change include:
- remove of all `u"abc"` forms, in favor of
  `from __future__ import unicode_literals`. Their usage was
  inconsistent anyway, leading to problems when mixing with
  unicode content.
- improve the tests, to allow printing for usecase even when
  crashing. Should make future test easier. This is done with a
  rather hacky `StdIO` class in `p3`, but it works.
- for some reason, the skipped test for Python 2 seems to work
  now. While the previous point might seem related, it is not clear
  that this is actually the case.
2018-04-10 14:45:54 +09:00
Fabien C. Y. Benureau
38133fc053 fix for utf8 citekeys 2018-04-10 14:44:01 +09:00
Olivier Mangin
50a44d964c
Merge branch 'master' into version 2018-04-03 12:36:52 -04:00
Olivier Mangin
801e0c035f
Adds code version to cache. (Fixes #129)
Current code version is added to the cache on writting. If the cache
version does not match the code version on read, the cache is ignored
which means it resets.
2018-03-30 19:16:23 -04:00
Olivier Mangin
0d7b44a3f5
Have version defined in only one place (fixes #86). 2018-03-30 18:47:21 -04:00
Olivier Mangin
bcf216183f
Fixes tests for printing help on --help and without argument.
(fix #135)
2018-03-27 15:44:20 -04:00
Olivier Mangin
12e8285674 Adds tag list completion in 2018-03-20 18:43:51 -04:00
Olivier Mangin
c28ab495cc
Removes journal customization (fixes #126) 2018-03-05 11:25:12 -05:00
Olivier Mangin
71c2f40657
Merge branch 'master' into fix/link_customization 2018-03-02 13:33:14 -05:00
Fabien C. Y. Benureau
3e376e2d8b remove obsolete exception catching 2018-02-27 13:18:59 +09:00
Olivier Mangin
a6d5df4059 Removes link and DOI customization. Fixes #119. 2018-02-21 16:14:38 -05:00
Fabien C. Y. Benureau
adbeb7f2b3 activating common strings by default in parser; fixes #122 2018-02-21 14:06:30 +09:00
Olivier Mangin
6e39cea473 Adds --strict option to list to force strict unicode comparison. 2018-02-20 18:06:33 -05:00
Olivier Mangin
f3ec9621ee Adds and checks unicode normalization. Fixes #103. 2018-02-20 18:06:33 -05:00
Olivier Mangin
1bcbf65dd8 Implements latex escape in queries. 2018-02-20 18:06:33 -05:00
Olivier Mangin
cff028d345 Minor refactoring of string comparison in query filters. 2018-02-20 18:06:33 -05:00
Olivier Mangin
078b2084ff Updates field orders to use 'url' and fixes broken test.
The field ordering test was broken on the latest bibtexparser since it
now replaces by default 'link' fields by 'url'.
2018-02-19 15:32:45 -05:00
Olivier Mangin
0b1ff7e441 PEP8 cosmetics. 2018-01-25 22:37:11 -05:00
Olivier Mangin
328f2a6d5e Adds more checks and better error message against empty citekeys. 2018-01-25 22:37:11 -05:00
Olivier Mangin
26f0b4dc04 Adds argcomplete command to pubs_cmd so that is now used as entry-point. 2018-01-25 16:09:30 -05:00
Olivier Mangin
ac536269e3 Removes script since unused with entry_points method 2018-01-23 16:21:38 -05:00
Olivier Mangin
a8716e6482 Adds completion for the --ignore-fields tag. 2018-01-07 13:54:38 -05:00
Olivier Mangin
860181e278 Adds argument to ignore fields in export. [Closes #67]
`pubs export --ignore-fields abstract,note CiteKey`
2018-01-07 13:40:06 -05:00
Olivier Mangin
07be993d02 Moves to using bibtexparser's writer for bibdata. [Fixes #33] 2018-01-07 12:59:55 -05:00
Bill Flynn
098cb4d1bf ran pep8 on pubs/utils 2018-01-05 21:38:47 -05:00
Bill Flynn
aea58dea29 [#95] refactored exception into standardize_doi 2018-01-05 21:31:19 -05:00
Bill Flynn
e2ad39ca08 [Fix #95] 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
3ad4a73da1 Moves query code from list_cmd to didicated module. 2018-01-05 14:34:24 -05:00
Olivier Mangin
0bd8d5b8dc Actually adds the functionality as well as a few more tests. 2018-01-05 14:34:24 -05:00
Olivier Mangin
832a20d743 Typo. 2018-01-05 14:34:24 -05:00
Olivier Mangin
84553d8eb3 [Fix #90] Adds year ranges to queries. 2018-01-05 14:34:24 -05:00
Olivier Mangin
c54de5c3b6 Refactors paper filtering from queries. 2018-01-05 14:34:24 -05:00
Olivier Mangin
e3f2e7db26 Cosmit. 2018-01-02 15:47:44 -05:00
Bill Flynn
4362c649b2 Added alias description functionality to conf #98
Changed Alias constructor, added tests for this behavior, and added
a few lines in the default conf describing how to define alias
descriptions.
2017-12-20 09:13:22 -05:00
Olivier Mangin
3e31c4455e Fixes argument and adds tests for overwrite on import. 2017-12-11 15:49:06 -05:00
Dennis Wilson
1cd95bdeec overwrite argument on import 2017-12-11 15:28:56 -05:00
Bill Flynn
0c7ba85af9 Revisions subject to comments on PR #100
Additionally, reverted FakeSystemExit subclassing Exception, but added
an explicit __init__ so that we can emulate the SystemExit.code
functionality without having to change the superclass.
2017-12-08 17:49:19 -05:00
Bill Flynn
66c90c5d43 Added unittest to cover new behavior pubs
Unittest just checks that both `pubs` and `pubs --help` raise a
`SystemExit` exception with error code 0.  Due to how argparse
handles the `--help` keyword, this is the best way I could think to
provide test coverage without heavily modifying the parser structure
or the unittest infrastructure.

To ensure the `pubs` matches the behavior of `pubs --help`, it now
raises the same `SystemExit(0)` exception via `sys.exit(0)`.  And
in order to catch it in the unittest, I had to modify the
`FakeSystemExit` behavior slightly.
2017-11-30 14:48:50 -05:00
Bill Flynn
ac3a8d8bf2 Print help menu when no subcommands applied
Made subparsers not required in the main parser, but if no commands are parsed,
then the parser prints its help.  When a command is present, the normal
functionality preserved.

Removed the single unittest that checks for this exact behavior.
2017-11-28 17:32:13 -05:00
Olivier Mangin
5676cb49a9
Merge pull request #96 from pubs/fix/content
Fixes content not read from urls because of call to `os.abspath`
2017-11-02 13:45:23 -04:00
Olivier Mangin
66b51997ea Fix defaults not used in config.
Basically the validation takes care of setting results that
post-processing was relying on. Hence the validation should occur before
the postprocessing. It actually makes more sense to validate within
post-process.
2017-10-19 16:40:45 -04:00
Olivier Mangin
6a26216c3e COSMIT 2017-10-19 15:46:42 -04:00
Olivier Mangin
a65873a7e0 Fixes abspath called on urls preventing to get content from url.
Fix #7
2017-10-19 15:40:58 -04:00
Olivier Mangin
47f5c918ea Fix #93: saves the modifications on edit -m. 2017-10-17 16:50:23 -04:00
Olivier Mangin
922781a89a Moves shell_quote import out of p3.py 2017-10-03 22:53:08 -04:00
Olivier Mangin
5c74f942c4 [Fix #88] Adds proper escaping for arguments in alias plugin. 2017-09-28 17:34:32 -04:00