about summary refs log blame commit diff stats
path: root/src/tools/bookmark_ignore.c
blob: 613a956f5ae7917c85dc65fe97d2aadb4ac92104 (plain) (tree)
pan class="nt">td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td> <td colspan=2><tt>This&nbsp;class&nbsp;contains&nbsp;definitions&nbsp;on&nbsp;how&nbsp;to&nbsp;run&nbsp;programs&nbsp;and&nbsp;should<br> be&nbsp;extended&nbsp;in&nbsp;ranger.defaults.apps<br> &nbsp;<br> The&nbsp;user&nbsp;can&nbsp;decide&nbsp;what&nbsp;program&nbsp;to&nbsp;run,&nbsp;and&nbsp;if&nbsp;he&nbsp;uses&nbsp;eg.&nbsp;'vim',&nbsp;the<br> function&nbsp;app_vim()&nbsp;will&nbsp;be&nbsp;called.&nbsp;&nbsp;However,&nbsp;usually&nbsp;the&nbsp;user<br> simply&nbsp;wants&nbsp;to&nbsp;"start"&nbsp;the&nbsp;file&nbsp;without&nbsp;specific&nbsp;instructions.<br> In&nbsp;such&nbsp;a&nbsp;case,&nbsp;app_default()&nbsp;is&nbsp;called,&nbsp;where&nbsp;you&nbsp;should&nbsp;examine<br> the&nbsp;context&nbsp;and&nbsp;decide&nbsp;which&nbsp;program&nbsp;to&nbsp;use.<br> &nbsp;<br> All&nbsp;app&nbsp;functions&nbsp;have&nbsp;a&nbsp;name&nbsp;starting&nbsp;with&nbsp;app_&nbsp;and&nbsp;return&nbsp;a&nbsp;string<br> containing&nbsp;the&nbsp;whole&nbsp;command&nbsp;or&nbsp;a&nbsp;tuple&nbsp;containing&nbsp;a&nbsp;list&nbsp;of&nbsp;the<br> arguments.<br> It&nbsp;has&nbsp;one&nbsp;argument,&nbsp;which&nbsp;is&nbsp;the&nbsp;<a href="#AppContext">AppContext</a>&nbsp;instance.<br> &nbsp;<br> You&nbsp;should&nbsp;define&nbsp;app_default,&nbsp;app_pager&nbsp;and&nbsp;app_editor&nbsp;since<br> internal&nbsp;functions&nbsp;depend&nbsp;on&nbsp;those.&nbsp;&nbsp;Here&nbsp;are&nbsp;sample&nbsp;implementations:<br> &nbsp;<br> def&nbsp;app_default(self,&nbsp;context):<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;context.file.media:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;context.file.video:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;detach&nbsp;videos&nbsp;from&nbsp;the&nbsp;filemanager<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.flags&nbsp;+=&nbsp;'d'<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;app_mplayer(context)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;app_editor(context)<br> &nbsp;<br> def&nbsp;app_pager(self,&nbsp;context):<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;('less',&nbsp;)&nbsp;+&nbsp;tuple(context)<br> &nbsp;<br> def&nbsp;app_editor(self,&nbsp;context):<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;('vim',&nbsp;)&nbsp;+&nbsp;tuple(context)<br>&nbsp;</tt></td></tr> <tr><td>&nbsp;</td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Applications-all"><strong>all</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;with&nbsp;all&nbsp;application&nbsp;functions</tt></dd></dl> <dl><dt><a name="Applications-app_self"><strong>app_self</strong></a>(self, context)</dt><dd><tt>Run&nbsp;the&nbsp;file&nbsp;itself</tt></dd></dl> <dl><dt><a name="Applications-get"><strong>get</strong></a>(self, app)</dt><dd><tt>Looks&nbsp;for&nbsp;an&nbsp;application,&nbsp;returns&nbsp;app_default&nbsp;if&nbsp;it&nbsp;doesn't&nbsp;exist</tt></dd></dl> <dl><dt><a name="Applications-has"><strong>has</strong></a>(self, app)</dt><dd><tt>Returns&nbsp;whether&nbsp;an&nbsp;application&nbsp;is&nbsp;defined</tt></dd></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> </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="-run"><strong>run</strong></a>(action<font color="#909090">=None</font>, **kw)</dt><dd><tt>Shortcut&nbsp;for&nbsp;creating&nbsp;and&nbsp;immediately&nbsp;running&nbsp;an&nbsp;<a href="#AppContext">AppContext</a>.</tt></dd></dl> <dl><dt><a name="-tup"><strong>tup</strong></a>(*args)</dt><dd><tt>This&nbsp;helper&nbsp;function&nbsp;creates&nbsp;a&nbsp;tuple&nbsp;out&nbsp;of&nbsp;the&nbsp;arguments.<br> &nbsp;<br> ('a',&nbsp;)&nbsp;+&nbsp;tuple(some_iterator)<br> is&nbsp;equivalent&nbsp;to:<br> <a href="#-tup">tup</a>('a',&nbsp;*some_iterator)</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> <td colspan=3 valign=bottom>&nbsp;<br> <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td> <td width="100%"><strong>ALLOWED_FLAGS</strong> = 'sdpSDP'<br> <strong>PIPE</strong> = -1<br> <strong>devnull</strong> = &lt;_io.TextIOWrapper name='/dev/null' encoding='UTF-8'&gt;</td></tr></table> </body></html>