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.
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.
- Update fake_env for compatibility with io.
- Uniform open (through _my_open in content).
- Fix read issue for config (although still using SafeConfigParser that
is deprecated in py3).
Originally intended to fix a bug in edit openning fils with non-ascii
characters.
Now all data is assumed to be manipulated as unicode. Therefore all
values returned by functions from content are unicode. There are a few
exception in order to download non-unicode data without failing to
decode. These exception are marked by the 'byte_' prefix.
The io package is used instead of builtin open for all file
transactions.
The fake_env test helper has to be modified (hacked, to be honnest) since
fake_filesystem does not offer a mock of io.
This is still WIP. Two issues still have to be solved:
- first there is an UnicodeWarning raised by bibparser,
- also config is still directly using builtin open.
* 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.