about summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.gui.colorscheme.html
blob: c44d0873334528279263767fc49a5fae434d2326 (plain) (blame)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.gui.colorscheme</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.<a href="ranger.gui.html"><font color="#ffffff">gui</font></a>.colorscheme</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/ranger/ranger/gui/colorscheme.py">/home/hut/ranger/ranger/gui/colorscheme.py</a></font></td></tr></table>
    <p><tt>Colorschemes&nbsp;define&nbsp;colors&nbsp;for&nbsp;specific&nbsp;contexts.<br>
&nbsp;<br>
Generally,&nbsp;this&nbsp;works&nbsp;by&nbsp;passing&nbsp;a&nbsp;set&nbsp;of&nbsp;keywords&nbsp;(strings)&nbsp;to<br>
the&nbsp;colorscheme.get()&nbsp;method&nbsp;to&nbsp;receive&nbsp;the&nbsp;tuple&nbsp;(fg,&nbsp;bg,&nbsp;attr).<br>
fg,&nbsp;bg&nbsp;are&nbsp;the&nbsp;foreground&nbsp;and&nbsp;background&nbsp;colors&nbsp;and&nbsp;attr&nbsp;is&nbsp;the&nbsp;attribute.<br>
The&nbsp;values&nbsp;are&nbsp;specified&nbsp;in&nbsp;ranger.gui.color.<br>
&nbsp;<br>
A&nbsp;colorscheme&nbsp;must...<br>
&nbsp;<br>
1.&nbsp;be&nbsp;inside&nbsp;either&nbsp;of&nbsp;these&nbsp;directories:<br>
~/.ranger/colorschemes/<br>
path/to/ranger/colorschemes/<br>
&nbsp;<br>
2.&nbsp;be&nbsp;a&nbsp;subclass&nbsp;of&nbsp;ranger.gui.colorscheme.<a href="#ColorScheme">ColorScheme</a><br>
&nbsp;<br>
3.&nbsp;implement&nbsp;a&nbsp;use(self,&nbsp;context)&nbsp;method&nbsp;which&nbsp;returns&nbsp;(fg,&nbsp;bg,&nbsp;attr).<br>
context&nbsp;is&nbsp;a&nbsp;struct&nbsp;which&nbsp;contains&nbsp;all&nbsp;entries&nbsp;of&nbsp;CONTEXT_KEYS,<br>
associated&nbsp;with&nbsp;either&nbsp;True&nbsp;or&nbsp;False.<br>
&nbsp;<br>
define&nbsp;which&nbsp;colorscheme&nbsp;to&nbsp;use&nbsp;by&nbsp;having&nbsp;this&nbsp;to&nbsp;your&nbsp;options.py:<br>
from&nbsp;ranger&nbsp;import&nbsp;colorschemes<br>
colorscheme&nbsp;=&nbsp;colorschemes.filename<br>
&nbsp;<br>
If&nbsp;your&nbsp;colorscheme-file&nbsp;contains&nbsp;more&nbsp;than&nbsp;one&nbsp;colorscheme,&nbsp;specify&nbsp;it&nbsp;with:<br>
colorscheme&nbsp;=&nbsp;colorschemes.filename.classname</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="ranger.html">ranger</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.gui.colorscheme.html#ColorScheme">ColorScheme</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ColorScheme">class <strong>ColorScheme</strong></a>(<a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>This&nbsp;is&nbsp;the&nbsp;class&nbsp;that&nbsp;colorschemes&nbsp;must&nbsp;inherit&nbsp;from.<br>
&nbsp;<br>
it&nbsp;defines&nbsp;<a href="#ColorScheme-get">get</a>()&nbsp;<br>
it&nbsp;defines&nbsp;the&nbsp;<a href="#ColorScheme-get">get</a>()&nbsp;method,&nbsp;which&nbsp;returns&nbsp;the&nbsp;color&nbsp;tuple<br>
which&nbsp;fits&nbsp;to&nbsp;the&nbsp;given&nbsp;keys.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ranger.gui.colorscheme.html#ColorScheme">ColorScheme</a></dd>
<dd><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="ColorScheme-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<dl><dt><a name="ColorScheme-get"><strong>get</strong></a>(self, *keys)</dt><dd><tt>Returns&nbsp;the&nbsp;(fg,&nbsp;bg,&nbsp;attr)&nbsp;for&nbsp;the&nbsp;given&nbsp;keys.<br>
&nbsp;<br>
Using&nbsp;this&nbsp;function&nbsp;rather&nbsp;than&nbsp;<a href="#ColorScheme-use">use</a>()&nbsp;will&nbsp;cache&nbsp;all<br>
colors&nbsp;for&nbsp;faster&nbsp;access.</tt></dd></dl>

<dl><dt><a name="ColorScheme-get_attr"><strong>get_attr</strong></a>(self, *keys)</dt><dd><tt>Returns&nbsp;the&nbsp;curses&nbsp;attribute&nbsp;for&nbsp;the&nbsp;specified&nbsp;keys<br>
&nbsp;<br>
Ready&nbsp;to&nbsp;use&nbsp;for&nbsp;curses.setattr()</tt></dd></dl>

<dl><dt><a name="ColorScheme-use"><strong>use</strong></a>(self, context)</dt><dd><tt>Use&nbsp;the&nbsp;colorscheme&nbsp;to&nbsp;determine&nbsp;the&nbsp;(fg,&nbsp;bg,&nbsp;attr)&nbsp;tuple.<br>
&nbsp;<br>
When&nbsp;no&nbsp;colorscheme&nbsp;is&nbsp;found,&nbsp;ranger&nbsp;will&nbsp;fall&nbsp;back&nbsp;to&nbsp;this&nbsp;very<br>
basic&nbsp;colorscheme&nbsp;where&nbsp;directories&nbsp;are&nbsp;blue&nbsp;and&nbsp;bold,&nbsp;and<br>
selected&nbsp;files&nbsp;have&nbsp;the&nbsp;color&nbsp;inverted.<br>
&nbsp;<br>
Override&nbsp;this&nbsp;method&nbsp;in&nbsp;your&nbsp;own&nbsp;colorscheme.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br>
<dl><dt><strong>settings</strong> = {}</dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-color_pair"><strong>color_pair</strong></a>(...)</dt></dl>
</td></tr></table>
</body></html>