350 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
52813439dd Removes useless beets_ui and FIX input issue between python 2 and 3. 2014-09-11 18:35:07 +02:00
Olivier Mangin
fd49c3acf2 Removes unappropriate encoding of string. 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
d758df2ac9 A few python3 fixes.
- Fix one implicit relative import.
- Fix call to file builtin in test_env.
- Fix deprecated lambda syntax.
2014-09-11 18:35:07 +02:00
Olivier Mangin
cac73d251c Removes unused paper number in bib_oneliner and filers. 2014-09-11 18:33:55 +02:00
Fabien Benureau
e1fd34a1ea alphabetical option for list command 2014-07-27 20:14:29 +02:00
Olivier Mangin
4df972821c DOC: papers <- pubs. 2014-05-28 15:25:19 +02:00
Olivier Mangin
47103058d6 FIX bug in query introduced by d3736e25.
Author name equlity to query is tested instead of query inclusion.
2014-05-28 15:10:51 +02:00
Olivier Mangin
4fd2e964b3 FIX bug in tag command (multiple line printed instead of one). 2014-05-22 18:41:26 +02:00
Olivier Mangin
0b64bf086e Update for latest bibtexparser (>= 0.5.3).
Breaks compatibility with previous versions. Also fixes the UnicodeWarning.
2014-04-28 20:53:49 +02:00
Olivier Mangin
89bf370902 Fails to add with existing citekey.
Also adds add usecase test and improves repository __contains__.
2014-04-28 20:08:05 +02:00
Olivier Mangin
39b2e4f912 Factorizes code for adding document.
- Document are added through repository method.
- Correct handling of the copy option.
- Does not check if document exists yet.
- Does not bypass copy=False if an url is given. Should it?
- Currently the document is actually pushed twice (not optimal).
2014-04-28 19:45:06 +02: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
3a149f655f Fix bug introduced by 78437acb4aab80f7c6cd5fa0f58de5ffd94d8ec5. 2014-04-23 16:52:31 +02:00
Fabien Benureau
48ad7e9b69 fix bug when calling 2014-04-21 19:17:39 +02:00
Fabien Benureau
84fd5d7649 fix #17 2014-04-20 02:41:30 +02:00
Olivier Mangin
78437acb4a Merge several steps towards python3 compatibility.
(From branch 'feat/python3' into develop.)
2014-04-19 22:38:18 +02:00
Olivier Mangin
6e6aa8b3ef Adds missing dateutil dependency. 2014-04-19 22:36:05 +02:00
Olivier Mangin
c45b64506a Merge branch 'develop' into feat/python3 2014-04-19 22:18:51 +02:00
Olivier Mangin
f59a017d6f Adds missing pyyaml dependency. 2014-04-19 22:12:09 +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
c9637b7607 Minor: unichr <- uchr. 2014-04-19 18:46:53 +02:00
Olivier Mangin
8136e0906e Fix use of range as list. 2014-04-19 18:14:01 +02:00
Olivier Mangin
bf2cce1c13 Only use print_function. 2014-04-19 18:09:46 +02:00
Olivier Mangin
571162a54d Adds renamed libs for python3. 2014-04-19 17:27:42 +02:00
Olivier Mangin
01fd368c97 Fix import and except syntax for python3. 2014-04-19 16:56:31 +02:00
Olivier Mangin
ed16f0bb5b Fix undefined variable and remove 'added' time (set by repo.push_paper). 2014-04-19 16:55:37 +02:00
Olivier Mangin
aedc59cf91 Minor: update requirements in readme. 2014-04-19 16:16:23 +02:00
Olivier Mangin
7713e5d80e Fix encoding of keywords.
Also introduces ustr instead of unicode for python2 and str for python3.
2014-04-18 20:43:26 +02:00
Olivier Mangin
9b6f6db297 Fixes editor formatting. 2014-04-18 17:51:20 +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
ac1562f4ea Fix open_cmd and misleading example from testrepo.
Open command was not using system_path to ensure user expansion.
Testrepo was using pubsdir:// instead of docsdir://. Although not
directly used in test this was misleading and incoherent.
Also fixes missing system_path in filebroker.
2014-04-17 21:07:48 +02:00
Olivier Mangin
0274f2640a Fix bug in export.
Not using ui.print_ was causing encoding error.
2014-04-17 19:45:00 +02:00
Olivier Mangin
b71b602a50 FIX bug in color when color not activated.
_nodye does not support being called with arg instead of kwarg.
Also improves pretty print and adds related tests.
2014-04-17 19:37:28 +02:00
Olivier Mangin
3e8b780e84 FIX bib_oneliner not robust to missing year. 2014-04-17 19:20:35 +02:00
Olivier Mangin
ad29b27412 FIX bugs witth added time.
Actually implement set of added time in repository.
Changes storage of added time (now as datetime.datetime).
2014-04-17 19:15:04 +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
Fabien Benureau
f2de611106 fixed last regression test 2014-04-17 12:53:13 +02:00
Olivier Mangin
07cb6f696c Adds back edit command.
The Repository rename_paper method has been updated. The citekey update
and syncronization with citekey in the bibdata should be handled in a
sane manner inside the Paper class.
2014-04-16 18:47:14 +02:00
Olivier Mangin
c9e4f9788c Moves removing of 'id' to endecoder where it belongs. 2014-04-16 16:21:40 +02:00
Olivier Mangin
e1ae125916 Removes texnotes plugin since it is too specific. 2014-04-16 16:07:12 +02:00
Olivier Mangin
8e467da979 Removes unused bug tracking, todo and note files. 2014-04-16 16:00:16 +02:00
Olivier Mangin
66ae19c256 Remove Coding guidelines (moved to github wiki). 2014-04-16 15:50:13 +02:00
Olivier Mangin
e4a25abcfb FIXES test_repo.
Removes 'id' entry from bibdata.
Fixes bug introduced in repo.
2014-04-15 21:09:10 +02:00
Olivier Mangin
c299874146 Fix use of color for import error while color module not yet imported. 2014-04-15 19:35:06 +02:00
Olivier Mangin
93c7fb2f27 Moves TestFakeFs helper to fake_env module. 2014-04-15 19:34:03 +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
Olivier Mangin
2f1a8ae42a Adds possibility to create repo when instance initialized.
This avoids having to manually call _create on filebroker.
2014-04-15 19:28:12 +02:00