summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.ext.get_all_modules.html
blob: 98a8867586968dc2ab5aadd6a9c601efc6eaa778 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.ext.get_all_modules</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.ext.html"><font color="#ffffff">ext</font></a>.get_all_modules</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/ext/get_all_modules.py">/home/hut/ranger/ranger/ext/get_all_modules.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Copyright&nbsp;(C)&nbsp;2009,&nbsp;2010&nbsp;&nbsp;Roman&nbsp;Zimbelmann&nbsp;&lt;romanz@lavabit.com&gt;<br>
#<br>
#&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br>
#&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br>
#&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or<br>
#&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.<br>
#<br>
#&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br>
#&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br>
#&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br>
#&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br>
#<br>
#&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License<br>
#&nbsp;along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.</tt></p>
<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="-get_all_modules"><strong>get_all_modules</strong></a>(dirname)</dt><dd><tt>returns&nbsp;a&nbsp;list&nbsp;of&nbsp;strings&nbsp;containing&nbsp;the&nbsp;names&nbsp;of&nbsp;modules&nbsp;in&nbsp;a&nbsp;directory</tt></dd></dl>
</td></tr></table>
</body></html>
39;\n" << end(); break; } string filename; if (!is_mu_string(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of '$open-file-for-writing' should be a string, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case _OPEN_FILE_FOR_WRITING: { string filename = read_mu_string(ingredients.at(0).at(0)); assert(sizeof(long long int) >= sizeof(FILE*)); long long int result = reinterpret_cast<long long int>(fopen(filename.c_str(), "w")); products.resize(1); products.at(0).push_back(static_cast<double>(result)); break; } :(before "End Primitive Recipe Declarations") _READ_FROM_FILE, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "$read-from-file", _READ_FROM_FILE); :(before "End Primitive Recipe Checks") case _READ_FROM_FILE: { if (SIZE(inst.ingredients) != 1) { raise << maybe(get(Recipe, r).name) << "'$read-from-file' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } string filename; if (!is_mu_number(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of '$read-from-file' should be a number, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case _READ_FROM_FILE: { long long int x = static_cast<long long int>(ingredients.at(0).at(0)); FILE* f = reinterpret_cast<FILE*>(x); if (f == NULL) { raise << maybe(current_recipe_name()) << "can't read from null file in '" << to_string(current_instruction()) << "'\n" << end(); break; } products.resize(1); if (feof(f)) { products.at(0).push_back(0); break; } if (ferror(f)) { raise << maybe(current_recipe_name()) << "file in invalid state in '" << to_string(current_instruction()) << "'\n" << end(); break; } char c = getc(f); // todo: unicode if (ferror(f)) { raise << maybe(current_recipe_name()) << "couldn't read from file in '" << to_string(current_instruction()) << "'\n" << end(); raise << " errno: " << errno << '\n' << end(); break; } products.at(0).push_back(c); break; } :(before "End Includes") #include <cerrno> :(before "End Primitive Recipe Declarations") _WRITE_TO_FILE, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "$write-to-file", _WRITE_TO_FILE); :(before "End Primitive Recipe Checks") case _WRITE_TO_FILE: { if (SIZE(inst.ingredients) != 2) { raise << maybe(get(Recipe, r).name) << "'$write-to-file' requires exactly two ingredients, but got '" << inst.original_string << "'\n" << end(); break; } string filename; if (!is_mu_number(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of '$write-to-file' should be a number, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } if (!is_mu_character(inst.ingredients.at(1))) { raise << maybe(get(Recipe, r).name) << "second ingredient of '$write-to-file' should be a character, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case _WRITE_TO_FILE: { long long int x = static_cast<long long int>(ingredients.at(0).at(0)); FILE* f = reinterpret_cast<FILE*>(x); if (f == NULL) { raise << maybe(current_recipe_name()) << "can't write to null file in '" << to_string(current_instruction()) << "'\n" << end(); break; } if (feof(f)) break; if (ferror(f)) { raise << maybe(current_recipe_name()) << "file in invalid state in '" << to_string(current_instruction()) << "'\n" << end(); break; } long long int y = static_cast<long long int>(ingredients.at(1).at(0)); char c = static_cast<char>(y); putc(c, f); // todo: unicode if (ferror(f)) { raise << maybe(current_recipe_name()) << "couldn't write to file in '" << to_string(current_instruction()) << "'\n" << end(); raise << " errno: " << errno << '\n' << end(); break; } break; } :(before "End Primitive Recipe Declarations") _CLOSE_FILE, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "$close-file", _CLOSE_FILE); :(before "End Primitive Recipe Checks") case _CLOSE_FILE: { if (SIZE(inst.ingredients) != 1) { raise << maybe(get(Recipe, r).name) << "'$close-file' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } string filename; if (!is_mu_number(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of '$close-file' should be a number, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case _CLOSE_FILE: { long long int x = static_cast<long long int>(ingredients.at(0).at(0)); FILE* f = reinterpret_cast<FILE*>(x); fclose(f); products.resize(1); products.at(0).push_back(0); // todo: ensure that caller always resets the ingredient break; }