60 Commits

Author SHA1 Message Date
Fabien Benureau
f843aebcbd Better handle utf-8 citekeys
Utf-8 citekeys generate errors in bibtexparser. Until this is fixed,
this commit replace the stack-trace by a clear error message.

related: #28
2015-12-16 16:38:40 +01:00
73
23890bf579 missed two somehow 2015-12-16 13:41:20 +01:00
73
5cc3f892a0 All commands that consume a citekey as an argument will now complete a
prefix.
2015-12-14 16:31:30 +01:00
73
a926c4c654 adds a *doc add|remove|export|open* command; depricates commands *open* and *attach*; fixed typos in readme.md and uis; 2015-12-13 21:34:48 +01:00
Fabien Benureau
f52a7202bb Better help for the list command 2015-12-12 15:08:22 +01:00
Fabien Benureau
796087af45 Fix missing update of dye in open command
Essentially reapply commit bd3659a432 that got swallowed in the merge.
2015-12-08 23:54:43 +01:00
Fabien Benureau
392ee0c3c1 Merge branch 'master' into feat/new_config
Add StringIO and BytesIO to FakeIO.
Fixes bytes/string problem in update()
2015-12-07 11:49:16 +01:00
Fabien Benureau
3099d353f9 Configurable colors and update improvement
Add a theme section in the configuration file to allow users to
set the colors used by different elements of the ui.

Improve the update mechanism so that incremental changes to the
configuration file can be incorporated.
2015-12-07 11:04:34 +01:00
Fabien Benureau
789db93911 Add platform-specific open and edit commands at init
The main motivation is to provide sensible default to make the
commnand "just work" without needing to fiddle with the configuration
2015-12-06 08:41:33 +01:00
Olivier Mangin
bd3659a432 Fixes missing update of dye in open command. 2015-12-06 00:58:29 -05:00
Fabien Benureau
14df0ad1cb Add pubs conf command
Allows to edit the configuration file using pubs directly.
Will check if the modified configuration file is valid.
2015-12-05 21:20:03 +01:00
Fabien Benureau
757a8b300e Add an update mechanism for old repositories
The update is done transparently, and displays a warning message explaining the change.
All the update machinery has been moved to the new update module.
2015-12-05 20:36:19 +01:00
Olivier Mangin
681ae65c9e Fixes issue #35.
pubs tag non-existing-citekey some-tag

Know fails as expected. The commit however removes the option of listing
tags as separate arguments.
2015-12-04 23:44:05 -05:00
Olivier Mangin
5480f79d8d Fixes ˇpubs tag citekey :sometagˇ not working.
Also adds a few tests for the tag command.
2015-12-04 23:20:19 -05:00
Fabien Benureau
93c54939b3 Rewritten config module
It depends on configobj, is cleaner and simpler than the previous implementation.
It adds comments in the config file, and type verification.

Related: #18
2015-12-04 20:49:05 +01:00
Fabien Benureau
4b3b2a23bd Improves interface of PrintUI
`print_out()` is replaced by `message()`, that redirect the output to
the stdout controlled by the PrintUI instance. Other than that, can be
used the same way as `print()`.
2015-12-03 16:09:54 +01:00
Fabien Benureau
cce9406670 new print ui, more robust colors 2015-12-02 16:36:27 +01:00
Fabien Benureau
8afb7a4777 Merge remote-tracking branch 'refs/remotes/origin/master' 2015-12-02 06:39:27 +01:00
Olivier Mangin
67aac0a2d7 Adds move option to add and attach commands.
When set removes original document file after copy.
2015-05-07 13:55:08 +02:00
Olivier Mangin
de2a50eeb2 Fix tests and terminology.
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.
2015-05-07 13:17:44 +02:00
Fabien Benureau
3aa64d4cd2 minor dialog update 2015-04-15 16:52:10 +02:00
Fabien Benureau
ec330571e8 option for listing all references without pdfs 2015-04-15 16:51:15 +02:00
Fabien Benureau
526dc6418f updated add cmds with isbn support, improved dialog, replaced -c and -C by single --link option 2015-01-24 01:01:31 +01:00
Fabien Benureau
9fe568805c fixed bug in attach cmds 2015-01-24 01:01:30 +01:00
Fabien Benureau
27a3058bee improved dialogs 2015-01-23 16:47:50 +01:00
Fabien Benureau
dd0475db46 added implicit autocompletion for open and edit cmds 2015-01-23 12:06:59 +01:00
Fabien Benureau
2cabdf4703 add dialog to delete the original docfile if copied 2015-01-22 04:08:35 +01:00
Fabien Benureau
69a045c203 remove more verbose, report action taken. 2015-01-22 04:06:03 +01:00
Fabien Benureau
97a0d15ca2 fix graceful exit when DOI is not recognized 2015-01-20 11:06:52 +01:00
Fabien Benureau
adb0158c3d experimental support for adding from DOIs 2015-01-08 14:58:41 +01:00
Olivier Mangin
f2125b4c19 Tags have to be printed in alphabetical order. 2014-09-11 18:47:11 +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
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
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
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
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
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
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
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
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