427 Commits

Author SHA1 Message Date
Fabien Benureau
a291114900 Remove duplicated edit_cmd code
Makes nano the default editor.

Fixes #46
2015-12-17 12:54:18 +01:00
Olivier Mangin
854702488c Fixes #46: editor command behaviors with the new config.
- Fix the previous default to 'None' (the string 'None', not None)
in the config.
- Adds support for using the $EDITOR when none is defined in the condif.
- Use ui.editor instead of content.editor in the add commnand.
2015-12-16 15:45:45 -05:00
Fabien Benureau
aa521576f5 More robust plugin list in conf
A single plugin name or an absence of it, with or without comma,
is now properly handled.

Related: #18
2015-12-16 17:02:38 +01:00
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
Fabien Benureau
402cf62db0 Merge pull request #42 from 73/master
`doc`, `info` command & prefix completion

+ Prefix completion, see #34 
+ Add `doc` command, closes #41 
+ Add `info` ui command, closes #43
2015-12-16 15:26:39 +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
69b2879fa2 added ui.info() and made it default for citekey completion 2015-12-14 13:24:13 +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
76be98a900 Merge pull request #37 from pubs/feat/new_config
feat/new_config: better, more robust, more flexible configuration
2015-12-12 15:17:30 +01:00
Fabien Benureau
f52a7202bb Better help for the list command 2015-12-12 15:08:22 +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
ba48941d93 Fixes alias plugins and adds it to packages. 2015-12-11 21:34:28 -05:00
Olivier Mangin
16aa0163f6 Removes automatic config update.
Makes it optional through command switch.
2015-12-11 21:33:54 -05:00
Olivier Mangin
af207e2604 Adds alias plugin test and fix its config access. 2015-12-11 20:11:38 -05:00
Fabien Benureau
414043e88e Add Arnold Sykosch to authors 2015-12-11 14:35:49 +01: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
Olivier Mangin
0bfe921ad9 Makes config updater robust ton undefined values. 2015-12-09 10:56:01 -05: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
4e204a41f2 Some more examples to README. 2015-12-05 00:39:54 -05: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
da4723d6db Minor rewrite in readme.md 2015-12-04 07:15:24 +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
17b420f102 Add supported python versions to readme
Given that PEP 0414 was only implemented on 3.3, Python 3
of version 3.2 and prior is not supported, as it would be
cumbersome to add, and 3.2 is used by few anyway.
2015-12-03 12:26:49 +01:00
Fabien Benureau
2151796cc4 Fix install in travis file 2015-12-03 10:16:58 +01:00
Fabien Benureau
174aea4008 Add travis support 2015-12-03 10:13:02 +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
b2dac68856 Add beautifulsoup4 dependency and update setup.py
A setup.cfg file was added for readme.md support on pypi.
Version number in setup.py is now the same as __version__ attribute.

Adresses: #31
2015-12-03 08:43:23 +01:00
Fabien Benureau
b8bcd6cc11 Fix color support
Fix bugs and regression on color support introduced by previous commits
2015-12-03 08:34:43 +01:00
Fabien Benureau
05ec6d274b Merge branch 'feat/config_overhaul': better color and ui
plain why this merge is necessary,
2015-12-02 16:54:23 +01:00
Fabien Benureau
cce9406670 new print ui, more robust colors 2015-12-02 16:36:27 +01:00
Fabien Benureau
d5a4fcf73c tighter utf-8 airlock in content.py 2015-12-02 06:39:58 +01:00
Fabien Benureau
8afb7a4777 Merge remote-tracking branch 'refs/remotes/origin/master' 2015-12-02 06:39:27 +01:00
Olivier Mangin
d2bd8a68b6 Doc: Fix readme dependancy. 2015-05-07 18:29:20 +02: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
Olivier Mangin
d0a1d64720 Fix warning about deprecated SafeConfigParser. 2015-05-07 10:58:29 +02:00
Olivier Mangin
45fc257575 Fixes #32.
Use key depending on bibtexparser version in endecoder.
2015-04-28 11:56:50 +02:00
Fabien Benureau
3aa64d4cd2 minor dialog update 2015-04-15 16:52:10 +02:00