101 Commits

Author SHA1 Message Date
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
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
Fabien Benureau
84fd5d7649 fix #17 2014-04-20 02:41:30 +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
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
ed16f0bb5b Fix undefined variable and remove 'added' time (set by repo.push_paper). 2014-04-19 16:55:37 +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
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
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
e4a25abcfb FIXES test_repo.
Removes 'id' entry from bibdata.
Fixes bug introduced in repo.
2014-04-15 21:09:10 +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
4ce261d636 more tests on tags 2013-11-18 15:04:34 +01:00
Fabien Benureau
dfd16c029d first working paper test + bugfix 2013-11-18 14:53:43 +01:00
Fabien Benureau
9243859294 updated test_usecase + fixed bug in import_cmd 2013-11-17 19:44:55 +01:00
Fabien Benureau
810525b4d0 fixed test_config 2013-11-17 19:20:42 +01:00
Fabien Benureau
23cf48661b added bibstruct text, cleaned fixtures and test_paper 2013-11-17 19:19:31 +01:00
Fabien Benureau
0b1a351485 bibstruct tests + bug fixes 2013-11-17 18:56:52 +01:00
Fabien Benureau
8d91545472 papers renamed 'pubs' 2013-11-14 04:40:29 +01:00
Fabien Benureau
1ad64d7859 notes cmd 2013-11-11 04:07:42 +01:00
Fabien Benureau
10fd0f86d6 only one usecase failing 2013-11-11 00:52:09 +01:00
Fabien Benureau
e0dab17dcd added troublesome bibfile 2013-11-10 21:49:53 +01:00
Fabien Benureau
8c54b19207 updated import and added rename command 2013-11-10 19:35:21 +01:00
Fabien Benureau
76a6d092dd fixed bug in datacache + added corresponding tests 2013-11-10 02:44:37 +01:00
Fabien Benureau
a774a1604e databroker, datacache class + tests 2013-11-09 19:39:59 +01:00
Fabien Benureau
15857b5ecc docbroker class + tests + more filebroker test 2013-11-09 18:35:31 +01:00
Fabien Benureau
c1bf80fe68 filebroker class + tests 2013-11-08 01:21:15 +01:00
Fabien Benureau
c4701953de fake_env module for fake fs, fake input 2013-11-08 01:19:59 +01:00
Fabien Benureau
856cfa2a4f moved test string fixtures to str_fixtures.py 2013-11-08 01:18:04 +01:00
Fabien Benureau
e26c606163 endecoder implementation 2013-11-07 22:48:40 +01:00
Olivier Mangin
e72f8fa7f2 Improves query handling for list command.
- Cleans code.
- Clever mode for case by default (case sensitive only if capitals in
  query).
- Adds basic tests.
- Conjunction of blocks.
- Options to override smart case.
2013-10-14 18:03:34 +02:00
Olivier Mangin
08811b842f Adds citekey argument to selectively import entries.
Also removes unused fatal argument from many_from_path and moves
printing of warning to the command.
2013-07-16 12:46:02 +02:00
Jonathan Grizou
62bdf7dfad Changed event system to allow more advance listener.
See associated test for example.
2013-07-06 22:02:03 +02:00
jgrizou
0801b3882d Merge branch 'develop' into plug/texnote 2013-07-05 18:10:40 +02:00
jgrizou
9cc893d8a7 Added AddEvent 2013-07-05 17:41:48 +02:00
jgrizou
7b555abf92 Change repo and removed the update function and the rename function. Now only the save_paper function must be used 2013-07-05 17:35:32 +02:00
Olivier Mangin
d5247a6618 Refactors usecase.
Integrate helpers into TestCase sub-classes to make use of setUp
mechanism.
2013-07-05 14:42:07 +02:00
Fabien Benureau
ab52785667 update test in test_usecases 2013-07-04 21:39:51 +01:00
Fabien Benureau
9c47951532 don't remove files at end of test.sh 2013-07-04 21:16:57 +01:00
Fabien Benureau
145710b928 test for every command except websearch and update 2013-07-04 21:15:03 +01:00