12 Commits

Author SHA1 Message Date
Olivier Mangin
ecb1910084 Better error message on UnicodeDecodeError for reading text file.
Also renames read_file to read_text_file which is what is implemented.
Fixes #51.
2016-01-15 19:02:56 -05: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
506bb24e50 Many cleanup in unicode encoding.
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.
2014-04-23 21:28:20 +02:00
Olivier Mangin
c45b64506a Merge branch 'develop' into feat/python3 2014-04-19 22:18:51 +02:00
Fabien Benureau
071730a49b fix #5 and achieve method parity between databroker and datacache 2014-04-19 21:11:02 +02:00
Olivier Mangin
571162a54d Adds renamed libs for python3. 2014-04-19 17:27:42 +02:00
Olivier Mangin
91b3fc75bb Several bug fixes.
- edit command fails correctly on unknown citekey,
- init command and filebroker use content module to check paths,
- fix wrong docfile in testrepo,
- list command does not fail on None added date (unknown add dates are
  older than everything else). Also adds relevant test.
2014-04-18 12:58:12 +02:00
Olivier Mangin
d2ba13700f Better handling of path (also fixes bugs).
Paths should be normalized through content.system_path before any actual
operation on files. This is in particular taken care of in content
functions check_file, check_dir, write_file, and read_file.
2014-04-17 18:17:57 +02:00
Olivier Mangin
de3dda85d1 FIX inconsistent error on push for existing paper.
The error raised by Repository.push_paper was different depending on
whether the existence of the paper in the repository was tested directly
through the filebroker (quicker when list of citekeys in not loaded) or
through the regular __contains__ method.
2014-04-15 19:32:29 +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
humm
2078876168 default bibfile formant is bibtex + fixed a bug in get_content 2013-11-14 18:37:27 +01:00
Fabien Benureau
8d91545472 papers renamed 'pubs' 2013-11-14 04:40:29 +01:00