[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ranger-users] let's discuss commands.py

From: Roman Z.
Subject: [Ranger-users] let's discuss commands.py
Date: Wed, 27 Feb 2013 18:50:01 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

In trying to keep things compatible between ranger versions and still
giving you much power through configuration files, I already moved from
apps.py to rifle.conf which is completely independent of ranger
internals, removed options.py and used an independent shell script for
generating previews.  Also, configs are compatible between releases with
the same major and minor version number.

Currently the config files are:

1. rc.conf     - no python, but relies on syntax of commands and on
                 commands.py to work properly
2. commands.py - relies heavily on ranger internals
3. rifle.conf  - independent
4. scope.sh    - independent

And there you see the problem that I want to talk about.  rc.conf
contains a list of ranger commands, so it relies on commands.py. But
commands.py works only if the user keeps it up to date.  If the user
does --copy-config=all and upgrades from ranger 1.5.* to ranger 1.6.0,
his commands will do wrong things.

A possible solution would be to remove system commands like "set",
"alias", "*map" from commands.py so the user won't overwrite them.
Maybe we can put them in a separate file, or in a part of commands.py
that is stripped off or commented out when using --copy-config.

Another would be to skip copying "commands.py" entirely when using
--copy-config=all, since the majority of the users don't care about
commands.py anyway.  One could still get it with --copy-config=commands.

Another way would be to make the commands bare-boned stubs which mostly
call API functions.  But would this reduce the use of the config file?

Maybe we could even remove the commands.py completely.  To be honest, my
commands.py is empty, since you can do a lot through rc.conf already.

I don't know.  What is your take on this?  Any other compatibility
issues you're worried about?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]