283 Commits

Author SHA1 Message Date
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
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
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
5c74f942c4 [Fix #88] Adds proper escaping for arguments in alias plugin. 2017-09-28 17:34:32 -04:00
Olivier Mangin
69d7587108 Adds test for configuration file content in usecase. 2017-08-01 23:43:06 -04:00
Fabien C. Y. Benureau
366575763c Remove duplicate test 2017-08-01 23:43:06 -04:00
Fabien C. Y. Benureau
0942df3b50 Fix pubs conf command 2017-08-01 23:43:06 -04:00
Olivier Mangin
da6f07c6c9 Adds basic API test for DOI and ISBN. 2017-07-22 15:42:12 -04:00
Olivier Mangin
4ffd62fe9f [notes] Allow different file extension for note file (see #70). 2017-07-12 10:41:51 -04:00
Olivier Mangin
9b6496d740 Removed commented code with old imports. 2017-07-11 17:26:08 -04:00
Olivier Mangin
323fb8b674 Fixes indent and removes unused io import. 2017-07-11 17:13:39 -04:00
Fabien C. Y. Benureau
3b4cfe635d Fix tests for Python 2
Also, some cleanup in fake_env.py
2017-07-11 17:08:53 -04:00
Fabien C. Y. Benureau
ce4b66e9b4 Fix unittests for Python 3 2017-07-11 17:08:52 -04:00
Olivier Mangin
a5466c940e Prepare configuration loading for autocomplete.
In particular, tries to load configuration when no argument is given.
Also removes unused check option from load_conf.
2017-07-08 00:10:15 -04:00
Olivier Mangin
6c2f0f6f8d Moves editor commands to ui to avoid using with wrong editor values.
For now, the editor_input and edit_file functions do not make sense
outside of the context of an ui. Having them in the content module
was confusing. (See issue fixed by a600855.)
2017-05-24 13:51:02 -04:00
Olivier Mangin
8ae339d870 Removes debug code and unused code. 2017-04-14 19:10:08 -04:00
Fabien C. Y. Benureau
0f84268ebf Honor custom pubsdoc in config 2016-06-06 00:25:27 +02:00
Fabien C. Y. Benureau
2aad93b526 Simplify, update the testsuite
Replace the in-house stubbing by the facilities offered
by pyfakefs for running tests. We don't use `io.open`
anymore, because pyfakefs does not stub it correctly.
We rely on a patched version of pyfakefs, as a few bug
remain in the official repo.
2016-06-05 21:48:19 +02:00
Olivier Mangin
2859e4bc62 More refactoring to remove code duplication. Also adds tests. 2016-02-02 21:21:24 -05: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 #13, Fix #14
2016-01-23 02:03:02 +01:00
Fabien Benureau
9ad6d8db25 Simplified fake_env code
1. Removed the unicode wrapper around fake_env io
2. Overrided pyfakefs cStringIO with StringIO (Python 2.x)
3. copy_dir will copy file in binary file to the fake filesystem
   *unless* they are bib, yaml, txt or md files
4. ui.handle_exception() conserve traceback

Numerous unicode subtelties required diving into pyfakefs and configobj
source code. Unicode on Python 2.x is the worst.
2016-01-21 16:18:16 +01:00
Fabien Benureau
620eef4ace Fix expectedFailure tests 2016-01-17 02:42:56 +01:00
Fabien Benureau
e979aae85b Better rename and error dialogue
info() messages now print on stdout. warning() and error() still
print on stderr.

Fix #50
2016-01-16 21:52:36 +01:00