26 Commits

Author SHA1 Message Date
Olivier Mangin
e129398311 Pass the config to plugins on parser modification to allow completion. 2017-07-08 00:10:15 -04:00
Olivier Mangin
02c11aaaea Adds completion for citekeys. 2017-07-08 00:10:15 -04:00
Olivier Mangin
a5466c940e Prepare configuration loading for autocomplete.
In particular, tries to load configuration when no argument is given.
Also removes unused check option from load_conf.
2017-07-08 00:10:15 -04:00
Olivier Mangin
af73d4ed64 Basic autocompletion with argcomplete.
Only support pubs command completion.
2017-07-08 00:10:15 -04:00
Olivier Mangin
a02f67f133 Minor improvement of error handling.
Also removes ignore of broken pipe from 5ca090668 since this is not
handling it the right way (see #60).
2017-05-11 15:49:35 -04:00
Olivier Mangin
df8f0e6d6b FIX error handler.
Also fix alignments.
2016-01-15 19:02:56 -05:00
Olivier Mangin
b12c6297f0 Adds exception catching in main command. 2016-01-15 19:02:56 -05:00
Fabien Benureau
2ba435126d Add --force-colors option
Useful when piping to a pager that supports color.
Improved and cleaned up a bit the ui functions too.

Related #44, #47
2015-12-18 22:35:19 +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
7186576aef Fix bug in args & less-aggressive update
Without args.prog, AliasCommand fail. Alias is better documented
in the readme and initial config files.

Update will now only trigger with version bumps. And the plugins
section is not updated. Removes the --upgrade flag.
2015-12-12 15:02:59 +01:00
Olivier Mangin
16aa0163f6 Removes automatic config update.
Makes it optional through command switch.
2015-12-11 21:33:54 -05:00
Fabien Benureau
eaa6ca8dab Proper error message when no subcommand is provided
On Python 3, invoking `pubs` would display a stacktrace, because
the subparser was not required.

This commit also simplifies the parser code by using .set_default()
to specify which command should be run.

This prompted changes in the plugin code. The code is still not
functioning, but many fixes in this commit bring the code closer
to a working state.
2015-12-10 22:14:38 +01:00
Fabien Benureau
4b21fa1355 Fix handling of version in argument parser 2015-12-10 21:50:18 +01:00
73
2871588703 implements #19 2015-12-10 12:50:38 +01: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
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
b71494ed42 Fix pubs init TypeError
The error was due to python 2 and 3 not playing nice when opening files.
This is probably linked to some botched unicode handling on our part somewhere
else is the package, and needs to be addressed when the `configs` module is
rewritten.

Also addresses some other minor unicode bugs.

Fix #27.
Related #18.
2015-12-03 10:00:19 +01:00
Fabien Benureau
29c6eaa8b5 Fix obsolete repo version
This fix is temporary. A better long-term solution should be found, and a less
intrusive update strategy devised.
2015-12-03 09:47:38 +01:00
Fabien Benureau
cce9406670 new print ui, more robust colors 2015-12-02 16:36:27 +01:00
Olivier Mangin
adb0caa3ed Use default python in executable. 2014-09-11 18:47:54 +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
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
Fabien Benureau
8d91545472 papers renamed 'pubs' 2013-11-14 04:40:29 +01:00