summary refs log blame commit diff stats
path: root/doc/HACKING
blob: 9dc219a680556f4371072b258371b22afaaa1ee0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                   
                                                   






                                                                  
                   

                                                                       
                                                            

 




                                               




                                   
                

 



                                                       
                          


                              
                           
                                             
                               




                                                            

                                                                      

                                                                              
                                                                    

                            
 
                                                   
                        





                                                                      




                 

                                                                              
Guidelines on Code Modification
===============================

Coding Style
------------

* Use syntax compatible to both python 2.6 and 3.1.
* Use docstrings with pydoc in mind
* Follow the style guide for python code:
    http://www.python.org/dev/peps/pep-0008/
* Test the code with "doctest" where it makes sense


Patches
-------

Send patches, created with "git format-patch", to the email adress

    hut@lavabit.com

If you plan to do major changes, or many changes over time, I encourage
you to create a fork on GitHub, Gitorious or any other site.


Starting Points
---------------

Good places to read about ranger internals are:
ranger/core/actions.py
ranger/fsobject/fsobject.py

About the UI:
ranger/gui/widgets/browsercolumn.py
ranger/gui/widgets/browserview.py
ranger/gui/ui.py


Common Changes
--------------

* Change which files are previewed in the auto preview:
In ranger/fsobject/file.py
the constant PREVIEW_BLACKLIST

* Adding options:
In ranger/config/options.py
add the default value, like: my_option = True
In ranger/container/settings.py
add the name of your option to the constant ALLOWED_SETTINGS

The setting is now accessible at self.settings.my_option,
assuming <self> is a "SettingsAware" object.

* Adding colorschemes:
Copy ranger/colorschemes/default.py to ranger/colorschemes/myscheme.py
and modify it according to your needs.  Alternatively, mimic the jungle
colorscheme.  It subclasses the default scheme and just modifies a few things.
In ranger/config/options.py (or ~/.config/ranger/options.py), change
    colorscheme = 'default'
to: colorscheme = 'myscheme'

* Change the file type => application associations:
In ranger/config/apps.py
modify the method app_default.
The variable "f" is a filesystem-object with attributes like mimetype,
extension, etc.  For a full list, check ranger/fsobject/fsobject.py

* Change the file extension => mime type associations:
Modify ranger/data/mime.types


Version Numbering
-----------------

Three numbers;  The first changes on a rewrite, the second changes when major
configuration incompatibilities occur and the third changes with each release.
tik K. Agaram <vc@akkartik.com> 2015-05-06 00:19:03 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-05-06 00:19:03 -0700 1279 - colorized rendering of the source files' href='/akkartik/mu/commit/html/003trace.test.cc.html?h=main&id=672e3e50c6ed6de161e40aa256c3fc0f2b1f7cf9'>672e3e50 ^
eaeb9552 ^
672e3e50 ^

65361948 ^
672e3e50 ^

eaeb9552 ^
672e3e50 ^

65361948 ^

672e3e50 ^

eaeb9552 ^
672e3e50 ^

65361948 ^


672e3e50 ^

eaeb9552 ^
672e3e50 ^

65361948 ^


672e3e50 ^
c5ffb6e1 ^
eaeb9552 ^
c5ffb6e1 ^













672e3e50 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156