209 Commits

Author SHA1 Message Date
Olivier Mangin
6e72b0e2f7
Merge branch 'master' into jma/arxiv 2018-08-02 12:01:10 +02:00
Olivier Mangin
ea2bc7f732
Merge branch 'master' into fix87 2018-08-01 15:02:01 +02:00
Olivier Mangin
3d76501a5c
Merge branch 'master' into fix/pyfakefs37 2018-08-01 14:36:24 +02:00
Fabien C. Y. Benureau
cf97f681ef
cleanup commented code, better reset_fs() 2018-08-01 14:37:23 +09:00
Fabien C. Y. Benureau
c76c7607f9
Upgrade pyfakefs to current version
Fix #148. Also did some cleanup on the tests.
2018-08-01 14:22:18 +09:00
Olivier Mangin
5a47150aad
Adds option to ignore malformed bibtex files or entry during import. 2018-07-30 18:24:56 +02:00
Olivier Mangin
60650b874a
Addresses minor comments (error message and better test). 2018-07-30 17:46:04 +02:00
Olivier Mangin
8a7d143261
Improves behaviors related to bibtex decoding error.
- from editor input in add and edit commands,
- from files in import command.
2018-07-25 22:20:14 +02:00
Olivier Mangin
d8dc386a18
Fix fake input behavior in tests on unexpected input.
Because of the mechanism for catching exceptions in pubs, the
UnexpectedInput exception raised by FakeInput never reached the catch
statement in the CommandTestCase and raised a FakeSystemExit instead.

This commit monkey-patches the exception handler in the ui at the same
time as the patching of the input functions to ignore UnexptectedInput
at the ui level.
2018-07-25 19:59:23 +02:00
Olivier Mangin
2f48f37199
Fixes duplicated test names in same TestCase (1st was not run). 2018-07-25 18:30:26 +02:00
Olivier Mangin
fbd29d27a4
Merge pull request #141 from pubs/feat/editor_missing
error message when editor is missing
2018-07-25 17:23:06 +02:00
Olivier Mangin
8fe650c040
Use join for joining paths. 2018-07-25 12:44:15 +02:00
Joe Antognini
f3c83668f9 Allow bibtex to be added from arxiv id.
This allows the user to add a reference via an arXiv ID similarly to how a reference can be added
from a DOI or ISBN.  If the arXiv ID has a DOI associated with it (according to the arXiv server),
the DOI will be used.  If it does not (perhaps the paper is unpublished), then a bibtex entry will
automatically be generated from the reference's metadata.

Note that a potential issue with this addition is that if a paper is added before it is published
(i.e., there is no DOI associated with it), and the paper is later published, the updated
information will have to be manually added.
2018-07-23 18:23:36 -06:00
ksunden
a0525b5147 Remove unused /dev/null 2018-05-22 20:56:34 -05:00
ksunden
2f59b4f2ce Clean up tests 2018-05-22 20:16:50 -05:00
ksunden
aaf2ed52c1 Use mock to test url command 2018-05-22 10:32:43 -05:00
Fabien C. Y. Benureau
6cd74a9966
error message when editor is missing
simplified a bit the ui code, to remove unecessary out-of-class functions
(needed anyway because of ui.error calls).
2018-05-17 09:22:31 +09: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
Fabien C. Y. Benureau
9a6db894d8 fix fakeenv creation when used from a non-primary volume 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
bcf216183f
Fixes tests for printing help on --help and without argument.
(fix #135)
2018-03-27 15:44:20 -04:00
Fabien C. Y. Benureau
f8a8e0e207 pyfakefs 3.3 2018-03-22 11:38:26 +09:00
Olivier Mangin
71c2f40657
Merge branch 'master' into fix/link_customization 2018-03-02 13:33:14 -05:00
Olivier Mangin
a6d5df4059 Removes link and DOI customization. Fixes #119. 2018-02-21 16:14:38 -05:00
Fabien C. Y. Benureau
82aad31e5d test for common_string parsing 2018-02-21 13:59:26 +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
248bf62317 Fixes unicode for python2 in test_queries. 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
c87b89bf10 Fix wrong test. 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
Fabien C. Y. Benureau
8126a0e0b4 Fix bibtex testcase, closes #25.
Also, made pyfakefs a straight pypi requirement, rather than a
github one, as no dev feature is needed since the last release.
2018-02-16 17:53:56 +09:00
Olivier Mangin
328f2a6d5e Adds more checks and better error message against empty citekeys. 2018-01-25 22:37:11 -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
aa408e9b2d [#95] updated doi tests 2018-01-05 21:31:46 -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
e069da518f Fixes query tests (assertFalse(not ...) and wrong name). 2018-01-05 18:04:59 -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
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
Bill Flynn
ebbd2d4f19 added another test for #98 2017-12-20 09:23:10 -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
Bill Flynn
37f076049b Many tests on MacOS 10.12.06 were failing due to fakefs path issues.
Not sure if this is needed.  Will see in the CI builds.
2017-12-08 17:51:06 -05:00