Commit Graph

23 Commits

Author SHA1 Message Date
Sławomir Nizio b2c8e2c819 [solo.commands.command] simplify and improve bash completions
Note: <tab> below can mean double <tab>.

This commit fixes cases such like the following ones:

* crash (issue !73) - e.g. KeyError: u'--mtime':
    - equo security oscheck --mtime <tab>
    - equo query graph --complete <tab>
      (this was due to a typo in variable name)

* now prints options, previously it didn't:
    - equo install -a <tab>

* crashed, or (with only variable name fixed) didn't print all options:
    - equo security oscheck --mtime <tab>
      (note that it worked with more special -q instead of --mtime etc.)

* didn't print all options:
    - equo query list installed <tab>
      (now shows also --by-user)

The following behaviour is still buggy:

* last typed word (note: no space before <tab>) disappears upon completion:
    - equo security oscheck<tab>
      (not a regression)
    - equo install --deep<tab>
      (here it's an option; regression! - previously it didn't complete but
      didn't cause the word to be erased either)

These can be corrected reliably when something like ${COMP_WORDS[COMP_CWORD]}
(from complete -F) is passed to the Python side.
Without this it's not possible to distinguish between `recognized_option<tab>`
(completion of recognized_option) and `recognized_option <tab>`.
2019-07-16 08:35:32 +02:00
Sławomir Nizio 7cf7e1f6b7 convert solo imports, with needed changes to entropy_path_loader
The module entropy_path_loader (used only for running from within the
checkout; otherwise not even installed) is made to provide the _entropy
namespace.

(Other ideas instead of this entropy_path_loader change would be to
reorganise files layout; drop support for running from the checkout as
is - and perhaps require virtualenvs; require sourcing a script that
sets PYTHONPATH. However, as implemented, it is not intrusive, and the
good part is that it is quite isolated, not used in normal usage after
installation. Basically, it only does sys.path + provides _entropy
namespace.)
2018-11-26 20:15:36 +01:00
Sławomir Nizio 789e06c122 [solo.commands.command, equo] support "authors" in docs
Suggested by Ettore.

My comment is that it is to have a more correct information and to give
credit where it is due.
This is not a "miscredit" towards the Creator. We know who has made this
possible!
2018-08-06 22:39:42 +02:00
Fabio Erculiani 3e528ae1ae [solo.commands.*] rename call_unlocked to call_shared, call_locked to call_exclusive 2013-12-12 22:15:47 +01:00
Fabio Erculiani ebf63e6060 [entropy.locks] fix shared/exclusive locking mix due to reentrancy, add tests 2013-12-08 16:15:39 +01:00
Fabio Erculiani 1917771b54 [entropy.locks] move Entropy Resources Lock code to a separate module 2013-12-08 14:37:57 +01:00
Fabio Erculiani 6b3f25a8ef [solo.commands.command] add sharedlock and exclusivelock decorators 2013-12-07 20:29:19 +01:00
Fabio Erculiani c26b8fb971 [solo.commands.command] use the Entropy class object to acquire the Entropy Resources Lock 2013-12-05 22:14:18 +01:00
Fabio Erculiani cd55a7a043 [solo.commands.command] call shutdown() before releasing locks
shutdown() calls EntropyCacher.sync() and stop()...
2013-08-10 11:03:24 +02:00
Fabio Erculiani 93debd109d [equo] wait indefinitely to acquire the resources lock using a spinner 2013-05-03 09:12:04 +02:00
Fabio Erculiani 8fda22bd0b [equo] monkey patch argparse.ArgumentParser to fix UTF-8 strings handling
See bug 4049.
2013-03-11 00:58:21 +00:00
Fabio Erculiani 113f9d74b7 [client] fix --help output when redirected through pipes, fix bug 4049 2013-03-08 12:55:13 +01:00
Fabio Erculiani 329da2587f [equo] fix UnicodeEncodeError as per bug #3873 2012-12-26 19:17:13 +01:00
Fabio Erculiani 977bc60b21 [Solo] get rid of solo.utils.show_you_meant, move _show_did_you_mean to SoloCommand 2012-11-04 18:43:42 +01:00
Fabio Erculiani d16578394f [Solo] move _setup_verbose_quiet_parser to SoloCommand 2012-11-03 17:45:17 +01:00
Fabio Erculiani 9dc1a6e6b9 [Solo] add __EQUO_LOCKS_BLOCKING__ env variable handling hack.
This hack is used by "equo upgrade" respawn (through execvp()) code.
2012-11-01 22:07:43 +01:00
Fabio Erculiani dccf747e51 [Solo] generate self._commands dict before calling _hierarchical_bashcomp() 2012-10-21 17:52:00 +02:00
Fabio Erculiani 8aaf088a26 [Solo] move common "hierarchical" bashcomp code to SoloCommand 2012-10-21 17:33:55 +02:00
Fabio Erculiani 4bcb12656e [Solo] add _argparse_is_valid_entropy_package() 2012-09-30 19:00:37 +02:00
Fabio Erculiani e23f4c809f [Solo] check against broken symlinks in _argparse_is_valid_directory 2012-09-30 18:59:59 +02:00
Fabio Erculiani 865813734b [Solo] implement argparse directory path validation function 2012-09-30 09:39:40 +02:00
Fabio Erculiani c7972c8519 [Solo] fixup code imports, add helper functions, migrate more code over 2012-08-21 21:03:46 +02:00
Fabio Erculiani 1582de0fff [Solo] First commit, equo rewrite has just begun
"Solo" is just a codename, to avoid name clashing while the code
is ported over.
2012-08-19 11:02:32 +02:00