summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.shared.mimetype.html
blob: 4ae8aabbd171962f1d24b34ae00c00abb8a7d0da (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.shared.mimetype</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</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.shared.html"><font color="#ffffff">shared</font></a>.mimetype</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/work/ranger/ranger/shared/mimetype.py">/home/hut/work/ranger/ranger/shared/mimetype.py</a></font></td></tr></table>
    <p></p>
<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="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.shared.mimetype.html#MimeTypeAware">MimeTypeAware</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="MimeTypeAware">class <strong>MimeTypeAware</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="MimeTypeAware-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<hr>
Data descriptors defined here:<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 defined here:<br>
<dl><dt><strong>mimetypes</strong> = {}</dl>

</td></tr></table></td></tr></table>
</body></html>
pan>("/xa \"Gone to the shops\""); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<show>xa</show>" "<status>Gone to the shops</status>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to xa (priority 0), \"Gone to the shops\".")); } void presence_dnd(void **state) { prof_connect(); prof_input("/dnd"); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<show>dnd</show>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to dnd (priority 0)")); } void presence_dnd_with_message(void **state) { prof_connect(); prof_input("/dnd \"Working\""); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<show>dnd</show>" "<status>Working</status>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to dnd (priority 0), \"Working\".")); } void presence_chat(void **state) { prof_connect(); prof_input("/chat"); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<show>chat</show>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to chat (priority 0)")); } void presence_chat_with_message(void **state) { prof_connect(); prof_input("/chat \"Free to talk\""); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<show>chat</show>" "<status>Free to talk</status>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to chat (priority 0), \"Free to talk\".")); } void presence_set_priority(void **state) { prof_connect(); prof_input("/priority 25"); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<priority>25</priority>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Priority set to 25.")); } void presence_includes_priority(void **state) { prof_connect(); prof_input("/priority 25"); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<priority>25</priority>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Priority set to 25.")); prof_input("/chat \"Free to talk\""); assert_true(stbbr_received( "<presence id='prof_presence_5'>" "<priority>25</priority>" "<show>chat</show>" "<status>Free to talk</status>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to chat (priority 25), \"Free to talk\".")); } void presence_keeps_status(void **state) { prof_connect(); prof_input("/chat \"Free to talk\""); assert_true(stbbr_received( "<presence id='prof_presence_4'>" "<show>chat</show>" "<status>Free to talk</status>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Status set to chat (priority 0), \"Free to talk\".")); prof_input("/priority 25"); assert_true(stbbr_received( "<presence id='prof_presence_5'>" "<show>chat</show>" "<status>Free to talk</status>" "<priority>25</priority>" "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>" "</presence>" )); assert_true(prof_output_exact("Priority set to 25.")); } void presence_received(void **state) { prof_connect(); stbbr_send( "<presence to='stabber@localhost' from='buddy1@localhost/mobile'>" "<priority>10</priority>" "<status>I'm here</status>" "</presence>" ); assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"")); } // Typical use case for gateways that don't support resources void presence_missing_resource_defaults(void **state) { prof_connect(); stbbr_send( "<presence to='stabber@localhost' from='buddy1@localhost'>" "<priority>15</priority>" "<status>My status</status>" "</presence>" ); assert_true(prof_output_exact("Buddy1 is online, \"My status\"")); prof_input("/info Buddy1"); assert_true(prof_output_exact("__prof_default (15), online")); }