Commit Graph

54 Commits

Author SHA1 Message Date
nvbn 251b69b5a0 #475: Try to use already used executable in no_command 2016-03-13 15:10:37 +03:00
Pablo Santiago Blum de Aguiar d8de5cfd20 #439 & #447: Remove cache if created with unavailable db
When switching between Python versions, the database package used to
create the cache might be unavailable and an ImportError is raised,
such as `ImportError: No module named gdbm`.
2016-03-08 14:38:16 -03:00
Pablo Santiago Blum de Aguiar 3cc4940842 #439 #447 Except anydbm instead of gdbm for PY2
Fix #439 and close #447
2016-02-14 00:43:07 -02:00
nvbn bbfd53d718 #N/A: Use shutil.which when possible 2016-02-06 16:42:42 +03:00
nvbn fe07fcaa62 #441: Remove shells methods wrappers 2016-01-29 13:09:40 +03:00
nvbn a2ec5aa3ff #441: Move function for getting current alias to utils 2016-01-29 12:22:31 +03:00
Pablo Santiago Blum de Aguiar cb6f964a30 Fix cache problem when going from Python 3 to 2 2016-01-21 23:57:17 -02:00
makalaaneesh 4f9fb796c4 fixes #425. command had to be re escaped 2016-01-08 00:50:26 +05:30
mcarton c3ea2fd0c7 Fix cache problem when going from Python 2 to 3 2015-11-15 16:55:07 +01:00
Alessio Treglia 7f777213c5 Fix misinterpretation of the disabled flag
The old implementation was misinterpretating the disabled flag and
effectively applying memoization even when explicitly disabled.
The 'or' operator is a short-circuit one; namely, it evaluates the
second argument if and only if the first is False. Therefore the
following conditions caused unexpected side effects:

- memoize.disabled = True, key not yet memoized

  Having disabled the memoize function wrapper, the client expects
  that no memoization happens. Instead the execution enters the
  if clause and store the value into the 'memo' dictionary

- memoize.disabled = True, key memoized

  Having disabled the memoize function wrapper, the client expects
  that no memoization happens and the function will be evaluated
  anyway, whether or not its return value had already been stored in
  the 'memo' dictionary by a previous call. On the contrary, the last
  statement of wrapper() access the value stored by the last function
  execution.

This commit attempts to improve the function readability too.
2015-11-04 22:44:50 +00:00
nvbn f20311fa89 #392: Little refactoring 2015-10-29 00:13:59 +08:00
mcarton e71a3e0cdb Replace (almost) all instance of script.split 2015-10-28 16:43:24 +01:00
mcarton ecfc180280 Add shells.quote 2015-10-28 14:16:01 +01:00
mcarton dae58211ba Parse command line with shlex
I put that in shells so that weird shells might try to parse it
differently.
2015-10-28 14:01:14 +01:00
nvbn 346cb99217 #385 Little refactoring 2015-10-21 18:13:22 +08:00
mcarton 8f25c95f06 Use XDG_CACHE_HOME for cache 2015-10-16 17:33:52 +02:00
nvbn b8ce95ad68 Minor refactoring 2015-09-08 15:24:49 +03:00
nvbn 7339a97b90 #364 Make aliases cache persistent 2015-09-07 19:05:38 +03:00
nvbn df4d2cc88d ⚠️ Remove settings param from rules match, get_new_command and side_effect 2015-09-07 13:00:29 +03:00
nvbn 382eb8b86c Fix tests 2015-09-07 12:12:16 +03:00
nvbn 105d3d8137 Make settings a global singleton 2015-09-06 21:47:12 +03:00
nvbn dd0667ea8f #356 Ignore thefuck entry points 2015-09-06 13:37:48 +03:00
nvbn 9a02e821cd Fix python 2 support 2015-09-02 11:54:58 +03:00
nvbn 4129ff2717 #353 Cache aliases in a temporary file 2015-09-02 11:10:03 +03:00
mcarton 8b62959fe3 Merge branch 'master' of github.com:nvbn/thefuck into slow 2015-09-01 14:28:30 +02:00
nvbn ebe53f0d18 Use decorator library 2015-08-27 16:52:26 +03:00
nvbn f2a7364e8c #351 Speed-up mvn rules, pep8 fixes 2015-08-27 16:10:50 +03:00
nvbn 9103c1ffd5 Add is_app/for_app helpers 2015-08-27 16:08:29 +03:00
mcarton 27c14a44af Fix tests
Thanks to [scorphus] for his [help].

[scorphus]: https://github.com/scorphus
[help]: https://github.com/nvbn/thefuck/pull/352#issuecomment-135248982
2015-08-27 10:54:42 +02:00
mcarton 51f1f44162 Memoize thefuck.utils.which
It is used by some rules to determine if they should be enabled by
default and searches in the $PATH, which can be quiet slow.
2015-08-26 21:43:20 +02:00
nvbn b21c9ebb43 Move all app/os specific utils to specific package 2015-08-25 14:09:47 +03:00
nvbn 2e002f666b Move utility functions from archlinux to utils 2015-08-25 13:55:33 +03:00
mcarton 986bbb30a7 Create thefuck.archlinux 2015-08-13 18:07:24 +02:00
nvbn d6e80b7835 #298 Suggest more than one result in *_no_command rules 2015-07-29 16:09:26 +03:00
nvbn 4bc1cc7849 #298 Add support of list results in sudo_support 2015-07-29 15:40:21 +03:00
Pablo Santiago Blum de Aguiar 4e854a575e Move get_all_matched_commands over to utils 2015-07-27 22:29:02 -03:00
nvbn 469c5a60b0 #N/A Add replace_argument helper 2015-07-24 00:39:56 +03:00
mcarton 903abff77e Support hub as well as git in @git_support 2015-07-21 15:06:04 +02:00
nvbn dee018e792 #N/A Move get_all_executables (formerly get_all_callables) to utils 2015-07-20 21:04:49 +03:00
nvbn 4f5659caad #87 Add ability to fix branch names in git_checkout rule 2015-07-20 19:25:29 +03:00
nvbn f90bac10ed #290: Fix typo 2015-07-19 21:29:28 +03:00
mcarton 5d0912fee8 Unquote over-quoted commands in @git_support
This allows writing rules more easily (eg. the git_branch_list rule
tests for `command.script.split() == 'git branch list'.split()`) and
looks nicer when `require_confirmation` is set.
2015-07-17 14:07:17 +02:00
mcarton b3e09d68df Start support for git aliases 2015-07-16 20:23:31 +02:00
nvbn f40b63f44b #N/A Add ability to disable memoization in tests 2015-07-10 17:06:05 +03:00
nvbn c0eae8b85c #N/A Add get_closest utility function 2015-07-08 21:30:24 +03:00
mcarton f3cdfbdbdb Add a sed_unterminated_s rule 2015-07-04 17:10:11 +02:00
nvbn a5aadc6e90 Bump to 1.44 2015-05-28 21:31:10 +03:00
nvbn 190e47ecdb #215 Use memoize decorator for caching 2015-05-22 17:07:01 +03:00
nvbn 5864faadef #165 fix python 2 support 2015-05-06 13:17:14 +02:00
nvbn d3d1f99232 Move special data types to types 2015-04-22 23:04:22 +02:00