Commit graph

156 commits

Author SHA1 Message Date
Florent
a5a4c2e44a Accept 0 and negative value for count
We already accept zero and negative value with the option -n, for
consistency it is good to accept it in interactive mode.
2014-01-07 18:59:19 +01:00
Florent
52111043e3 Revert part of e15b2a8473 2014-01-07 12:57:36 +01:00
Florent
9223d92fc8 restrict ls to 40 results by default 2014-01-06 17:13:16 +01:00
Florent
0b39d2d873 Coding style 2014-01-06 15:17:21 +01:00
Florent
3bb4b50ba0 Fix bug introduced in ReplApplication.get_object refactoring
Ref e15b2a8473
    e0417f702d
    0668db2b5a
2014-01-06 14:58:29 +01:00
Pierre Mazière
0668db2b5a ReplApplication.get_object(): fix backend lookup
because self.enabled_backends contains BaseBackend objects
and not backend name strings

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2014-01-05 22:46:05 +01:00
Pierre Mazière
e0417f702d ReplApplication.get_object(): exclude backends which does not implement 'method'
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2014-01-05 22:46:04 +01:00
Pierre Mazière
e15b2a8473 ReplApplication.get_object(): return None if method does not exist
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2014-01-05 22:46:04 +01:00
Florent
105ec527b5 Sort results of ls by default
and replace option -s by option -U (same than the real ls command)
refs #1079
2013-12-17 15:21:25 +01:00
Florent
920e8edc44 Add documentation on conditions 2013-12-16 16:40:14 +01:00
Florent
af5452091b Add -s option to ls (sort by backend/id)
closes #1079
2013-12-16 14:31:23 +01:00
Florent
3983590d76 Remove condition in format function
Forgot to clean it in a3e6e98b4e
2013-12-16 14:00:03 +01:00
Florent
a3e6e98b4e Move condition code in BaseApplication
The count parameter is now consistent with condition parameter
close #1289
2013-12-15 16:47:42 +01:00
Florent
8b2ced6dc5 Do not return None objects on get_object
Fix the "bug" of passing urls to videoob with
multiple backends.
2013-11-07 09:15:58 +01:00
Florent
c712da56a3 Catch errors in boobill (cmds without args)
Closes #1303
2013-10-28 18:25:52 +01:00
Florent
9fee613cba Call self.weboob.do in ReplApplication.get_object_list 2013-10-28 17:00:02 +01:00
Florent
9a0f9d0fc9 Remove condition from core 2013-08-06 19:05:21 +02:00
Florent
29567cffa4 Enable infinite search by default is condition is set 2013-08-06 18:54:49 +02:00
Florent
6b0930ffc5 Move condition from BCall to Repl 2013-08-06 18:45:03 +02:00
Romain Bignon
82fe5f7df0 several fixes about command helps
- add help on command help
- add bold in do_help instead of get_command_help
- get_commands_doc() returns full help
2013-08-03 12:28:05 +02:00
Romain Bignon
9fe4faa6bb add missing docstrings to commands 2013-07-28 00:23:31 +02:00
Romain Bignon
46d9acd37e display a message when more results are available (closes #1038) 2013-07-27 23:40:24 +02:00
Romain Bignon
4c4fb24291 ls: display collections before objects 2013-07-27 23:40:24 +02:00
Romain Bignon
bcc75c37c7 add bold on command syntax in help 2013-07-27 18:43:13 +02:00
Romain Bignon
9094294683 default behavior is to unlimit results, except for explicit commands (searches or history)
closes #1139
2013-07-27 15:56:45 +02:00
Romain Bignon
f1305f0daa invoking 'help' command from shell display only list of commands (no options) 2013-07-27 15:56:45 +02:00
Laurent Bachelier
a6ad7e83ff Use newer form of catching exceptions
autopep8 -i --select=W602
Also some other minor deprecated syntax changes, like "while 1".
I did not commit the less obvious changes.
2013-07-27 15:16:16 +02:00
Romain Bignon
a98ab89671 get_object supports backend's services returning lists 2013-07-27 14:28:10 +02:00
Florent Fourcot
34bb4d52a1 Add a new caps parameter to get_object 2013-07-16 23:00:41 +02:00
Laurent Bachelier
c21d1f7925 Code clarity fixes
autopep8 -ir -j2 --select=E303,E125
Diff checked manually.
2013-03-16 00:52:43 +01:00
Florent
0072b5e076 Allow infinite search with 0 2013-02-07 14:51:38 +01:00
Romain Bignon
b770163d9b fix crash when there is no selected fields (yes, all the time, why nobody has reported it) 2013-02-07 14:21:06 +01:00
Romain Bignon
8550c17cf7 do not cry if an object in not support to be filled by a backend 2013-01-30 11:34:28 +01:00
Laurent Bachelier
4d1e6f8436 Add support for ls -d option (closes #858)
This behaves like the UNIX ls -d.
This should solve the use case of Bug #858; ls was never intended to
work that way before. Users can now chose between the two modes (with or
without -d).
2013-01-10 09:38:09 +01:00
Laurent Bachelier
f48c81de53 Properly get to the previous path, not home 2012-11-08 11:51:52 +01:00
Romain Bignon
538578c83f don't crash when there the input is empty 2012-07-23 17:25:07 +02:00
Florent
d0c7a18d20 Add suggestion of commands in case of if "unknown"
Very useful to find the good short alias...
2012-07-20 19:32:50 +02:00
Florent
37c68b7ba6 Search and execute short command alias 2012-07-20 19:31:24 +02:00
Romain Bignon
8e550b4196 handle UserError during fillobj 2012-06-16 13:52:03 +02:00
Romain Bignon
6f46c41743 do not fail during fullobj() if the object is not supported by backend 2012-04-28 16:38:55 +02:00
Romain Bignon
e5474c26a1 remove '-' from readline delims 2012-04-27 14:31:44 +02:00
capitaldata
5e8ac671da add list-modules option in the command line interface
ex: radioob> backends list-modules

Signed-off-by: capitaldata <capitaldata@capitaldata-desktop2.(none)>
Signed-off-by: Romain Bignon <romain@symlink.me>
2012-04-27 14:31:40 +02:00
Florent
92d5e9ea0f Get all available subscriptions for details command
Add a new method get_object_list to ReplApplication
Should close #846.
2012-04-25 13:50:42 +02:00
Romain Bignon
20835e5180 ls: clear objects list 2012-04-10 13:25:55 +02:00
Romain Bignon
fc849995f4 rewrite of the formatters system 2012-04-03 22:40:38 +02:00
Romain Bignon
c6a141595c change way to describe fields of CapBaseObject, and lot of documentation 2012-03-26 14:35:54 +02:00
Romain Bignon
1833952af1 fix completion of 'cd' after using 'ls' with a parameter 2012-03-25 09:45:31 +02:00
theo
67ae0893cd Add completion to ls in CapCollection
The completion is the same code as ls used to call.
2012-03-20 07:52:40 +01:00
theo
8c977825b9 ls dir is equivalent to cd dir + ls + cd ..
Until now, ls discarded arguments.

ls = ls dir:

videoob> ls
~ (emissions) Emissions (canalplus)
~ (sport) Sport (canalplus)
~ (cinema) Cinema (canalplus)
~ (cesar-2012) Cesar 2012 (canalplus)
~ (series-fictions) Series / fictions (canalplus)
~ (du-hard-ou-du-cochon) Du hard ou du cochon (canalplus)
~ (divertissement) Divertissement (canalplus)
~ (canal-street) Canal street (canalplus)
~ (musique) Musique (canalplus)
~ (docus-infos) Docus / infos (canalplus)
videoob> ls sport
~ (emissions) Emissions (canalplus)
~ (sport) Sport (canalplus)
~ (cinema) Cinema (canalplus)
~ (cesar-2012) Cesar 2012 (canalplus)
~ (series-fictions) Series / fictions (canalplus)
~ (du-hard-ou-du-cochon) Du hard ou du cochon (canalplus)
~ (divertissement) Divertissement (canalplus)
~ (canal-street) Canal street (canalplus)
~ (musique) Musique (canalplus)
~ (docus-infos) Docus / infos (canalplus)

With this patch, we are now able to ls a dir without chdir into it.

For instance:
videoob> ls
~ (emissions) Emissions (canalplus)
~ (sport) Sport (canalplus)
~ (cinema) Cinema (canalplus)
~ (cesar-2012) Cesar 2012 (canalplus)
~ (series-fictions) Series / fictions (canalplus)
~ (du-hard-ou-du-cochon) Du hard ou du cochon (canalplus)
~ (divertissement) Divertissement (canalplus)
~ (canal-street) Canal street (canalplus)
~ (musique) Musique (canalplus)
~ (docus-infos) Docus / infos (canalplus)
videoob> ls sport
~ (les-incontournables) Les incontournables (canalplus)
~ (les-plus-recentes) Les plus recentes (canalplus)
~ (les-plus-vues) Les plus vues (canalplus)
~ (tout-le-football) Tout le football (canalplus)
~ (tout-le-rugby) Tout le rugby (canalplus)
~ (tout-le-basket) Tout le basket (canalplus)
~ (tout-le-tennis-golf) Tout le tennis / golf (canalplus)
~ (autres-sports-home-sport) Autres sports - home sport (canalplus)
~ (les-emissions-sport) Les emissions sport (canalplus)
videoob> ls
~ (emissions) Emissions (canalplus)
~ (sport) Sport (canalplus)
~ (cinema) Cinema (canalplus)
~ (cesar-2012) Cesar 2012 (canalplus)
~ (series-fictions) Series / fictions (canalplus)
~ (du-hard-ou-du-cochon) Du hard ou du cochon (canalplus)
~ (divertissement) Divertissement (canalplus)
~ (canal-street) Canal street (canalplus)
~ (musique) Musique (canalplus)
~ (docus-infos) Docus / infos (canalplus)

Signed-off-by: theo <theocrite@theocrite.org>
2012-03-16 17:20:18 +01:00
Laurent Bachelier
fae4470101 Prepare for objects that are also Collections
Don't force objects to have an id, especially since that id was
incorrect. "plap/plop" would have the same id as "plop", i.e. "plop".
We don't rely on the id for handling Collections anymore.

Change to use more unique property names.

Change the display, instead of using '*', we use '~', and there is no
"Collection" header anymore.
Updated formatters could use that way of showing the object is also a
collection too.

refs #774
2012-03-13 22:08:46 +01:00