1 Guidelines for Code Modification
2 ================================
7 * Use syntax compatible to both python 2.6+ and 3.1+.
8 * Use docstrings with pydoc in mind
9 * Follow the style guide for python code:
10 http://www.python.org/dev/peps/pep-0008/
11 * Test the code with "doctest" where it makes sense
17 Send patches, created with "git format-patch", to the email address
21 or open a pull request on GitHub.
27 Three numbers, A.B.C, where
28 * A changes on a rewrite
29 * B changes when major configuration incompatibilities occur
30 * C changes with each release
36 Good places to read about ranger internals are:
38 * ranger/core/actions.py
39 * ranger/container/fsobject.py
43 * ranger/gui/widgets/browsercolumn.py
44 * ranger/gui/widgets/browserview.py
54 * Add a default value in rc.conf, along with a comment that describes the option.
55 * Add the option to the ALLOWED_SETTINGS dictionary in the file
56 ranger/container/settings.py. Make sure to sort in the new entry
58 * Add an entry in the man page by editing doc/ranger.pod, then rebuild the man
59 page by running "make man" in the ranger root directory
61 The setting is now accessible with self.settings.my_option, assuming self is a
62 subclass of ranger.core.shared.SettingsAware.
68 * Copy ranger/colorschemes/default.py to ranger/colorschemes/myscheme.py
69 and modify it according to your needs. Alternatively, create a subclass of
70 ranger.colorschemes.default.Default and override the "use" method, as it is
71 done in the "Jungle" colorscheme.
73 * Add this line to your ~/.config/ranger/rc.conf:
75 set colorscheme myscheme
78 Change which programs start which file types
79 --------------------------------------------
81 Edit the configuration file ~/.config/ranger/rifle.conf. The default one can
82 be obtained by running "ranger --copy-config rifle".
85 Change which file extensions have which mime type
86 -------------------------------------------------
88 Modify ranger/data/mime.types. You may also add your own entries to ~/.mime.types
91 Change which files are previewed in the auto preview
92 ----------------------------------------------------
94 In ranger/container/file.py, change the constant PREVIEW_BLACKLIST