9 Commits

Author SHA1 Message Date
Olivier Mangin
0479636393 Fix issues with stdout and updates tests.
Not so clean since trying to change stdout encoding requires accessing
sys.stdout.buffer, so fake_env has to mock this layer also. The basic
differences between p2 and p3 are handled in p3.py.
2014-09-11 18:35:07 +02:00
Olivier Mangin
136b8f83dc Fix fake_env, fix configparser issues, uniform 'open'.
- 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).
2014-09-11 18:35:07 +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
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
93c7fb2f27 Moves TestFakeFs helper to fake_env module. 2014-04-15 19:34:03 +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
Fabien Benureau
8d91545472 papers renamed 'pubs' 2013-11-14 04:40:29 +01:00
Fabien Benureau
8c54b19207 updated import and added rename command 2013-11-10 19:35:21 +01:00
Fabien Benureau
c4701953de fake_env module for fake fs, fake input 2013-11-08 01:19:59 +01:00