summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.ext.get_all_modules.html
blob: a1cc8a5023827506388928be28f031a94a6c5306 (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
<!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;hut&nbsp;&lt;hut@lavabit.com&gt;<br>
#<br>
#&nbsp;Permission&nbsp;to&nbsp;use,&nbsp;copy,&nbsp;modify,&nbsp;and/or&nbsp;distribute&nbsp;this&nbsp;software&nbsp;for&nbsp;any<br>
#&nbsp;purpose&nbsp;with&nbsp;or&nbsp;without&nbsp;fee&nbsp;is&nbsp;hereby&nbsp;granted,&nbsp;provided&nbsp;that&nbsp;the&nbsp;above<br>
#&nbsp;copyright&nbsp;notice&nbsp;and&nbsp;this&nbsp;permission&nbsp;notice&nbsp;appear&nbsp;in&nbsp;all&nbsp;copies.<br>
#<br>
#&nbsp;THE&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;"AS&nbsp;IS"&nbsp;AND&nbsp;THE&nbsp;AUTHOR&nbsp;DISCLAIMS&nbsp;ALL&nbsp;WARRANTIES<br>
#&nbsp;WITH&nbsp;REGARD&nbsp;TO&nbsp;THIS&nbsp;SOFTWARE&nbsp;INCLUDING&nbsp;ALL&nbsp;IMPLIED&nbsp;WARRANTIES&nbsp;OF<br>
#&nbsp;MERCHANTABILITY&nbsp;AND&nbsp;FITNESS.&nbsp;IN&nbsp;NO&nbsp;EVENT&nbsp;SHALL&nbsp;THE&nbsp;AUTHOR&nbsp;BE&nbsp;LIABLE&nbsp;FOR<br>
#&nbsp;ANY&nbsp;SPECIAL,&nbsp;DIRECT,&nbsp;INDIRECT,&nbsp;OR&nbsp;CONSEQUENTIAL&nbsp;DAMAGES&nbsp;OR&nbsp;ANY&nbsp;DAMAGES<br>
#&nbsp;WHATSOEVER&nbsp;RESULTING&nbsp;FROM&nbsp;LOSS&nbsp;OF&nbsp;USE,&nbsp;DATA&nbsp;OR&nbsp;PROFITS,&nbsp;WHETHER&nbsp;IN&nbsp;AN<br>
#&nbsp;ACTION&nbsp;OF&nbsp;CONTRACT,&nbsp;NEGLIGENCE&nbsp;OR&nbsp;OTHER&nbsp;TORTIOUS&nbsp;ACTION,&nbsp;ARISING&nbsp;OUT&nbsp;OF<br>
#&nbsp;OR&nbsp;IN&nbsp;CONNECTION&nbsp;WITH&nbsp;THE&nbsp;USE&nbsp;OR&nbsp;PERFORMANCE&nbsp;OF&nbsp;THIS&nbsp;SOFTWARE.</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>
class="w"> big"2147483647".toCstring(2) == "1111111111111111111111111111111".cstring func toCstring*(this: JsBigInt): cstring {.importjs: "#.toString()".} ## Converts from `JsBigInt` to `cstring` representation. ## https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/toString func `$`*(this: JsBigInt): string = ## Returns a `string` representation of `JsBigInt`. runnableExamples: doAssert $big"1024" == "1024n" $toCstring(this) & 'n' func wrapToInt*(this: JsBigInt; bits: Natural): JsBigInt {.importjs: "(() => { const i = #, b = #; return BigInt.asIntN(b, i) })()".} = ## Wraps `this` to a signed `JsBigInt` of `bits` bits in `-2 ^ (bits - 1)` .. `2 ^ (bits - 1) - 1`. ## https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asIntN runnableExamples: doAssert (big("3") + big("2") ** big("66")).wrapToInt(13) == big("3") func wrapToUint*(this: JsBigInt; bits: Natural): JsBigInt {.importjs: "(() => { const i = #, b = #; return BigInt.asUintN(b, i) })()".} = ## Wraps `this` to an unsigned `JsBigInt` of `bits` bits in 0 .. `2 ^ bits - 1`. ## https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN runnableExamples: doAssert (big("3") + big("2") ** big("66")).wrapToUint(66) == big("3") func toNumber*(this: JsBigInt): int {.importjs: "Number(#)".} = ## Does not do any bounds check and may or may not return an inexact representation. runnableExamples: doAssert toNumber(big"2147483647") == 2147483647.int func `+`*(x, y: JsBigInt): JsBigInt {.importjs: "(# $1 #)".} = runnableExamples: doAssert (big"9" + big"1") == big"10" func `-`*(x, y: JsBigInt): JsBigInt {.importjs: "(# $1 #)".} = runnableExamples: doAssert (big"9" - big"1") == big"8" func `*`*(x, y: JsBigInt): JsBigInt {.importjs: "(# $1 #)".} = runnableExamples: doAssert (big"42" * big"9") == big"378" func `div`*(x, y: JsBigInt): JsBigInt {.importjs: "(# / #)".} = ## Same as `div` but for `JsBigInt`(uses JavaScript `BigInt() / BigInt()`). runnableExamples: doAssert big"13" div big"3" == big"4" doAssert big"-13" div big"3" == big"-4" doAssert big"13" div big"-3" == big"-4" doAssert big"-13" div big"-3" == big"4" func `mod`*(x, y: JsBigInt): JsBigInt {.importjs: "(# % #)".} = ## Same as `mod` but for `JsBigInt` (uses JavaScript `BigInt() % BigInt()`). runnableExamples: doAssert big"13" mod big"3" == big"1" doAssert big"-13" mod big"3" == big"-1" doAssert big"13" mod big"-3" == big"1" doAssert big"-13" mod big"-3" == big"-1" func `<`*(x, y: JsBigInt): bool {.importjs: "(# $1 #)".} = runnableExamples: doAssert big"2" < big"9" func `<=`*(x, y: JsBigInt): bool {.importjs: "(# $1 #)".} = runnableExamples: doAssert big"1" <= big"5" func `==`*(x, y: JsBigInt): bool {.importjs: "(# == #)".} = runnableExamples: doAssert big"42" == big"42" func `**`*(x, y: JsBigInt): JsBigInt {.importjs: "((#) $1 #)".} = # (#) needed due to unary minus runnableExamples: doAssert big"2" ** big"64" == big"18446744073709551616" doAssert big"-2" ** big"3" == big"-8" doAssert -big"2" ** big"2" == big"4" # parsed as: (-2n) ** 2n doAssert big"0" ** big"0" == big"1" # edge case var ok = false try: discard big"2" ** big"-1" # raises foreign `RangeError` except: ok = true doAssert ok func `and`*(x, y: JsBigInt): JsBigInt {.importjs: "(# & #)".} = runnableExamples: doAssert (big"555" and big"2") == big"2" func `or`*(x, y: JsBigInt): JsBigInt {.importjs: "(# | #)".} = runnableExamples: doAssert (big"555" or big"2") == big"555" func `xor`*(x, y: JsBigInt): JsBigInt {.importjs: "(# ^ #)".} = runnableExamples: doAssert (big"555" xor big"2") == big"553" func `shl`*(a, b: JsBigInt): JsBigInt {.importjs: "(# << #)".} = runnableExamples: doAssert (big"999" shl big"2") == big"3996" func `shr`*(a, b: JsBigInt): JsBigInt {.importjs: "(# >> #)".} = runnableExamples: doAssert (big"999" shr big"2") == big"249" func `-`*(this: JsBigInt): JsBigInt {.importjs: "($1#)".} = runnableExamples: doAssert -(big"10101010101") == big"-10101010101" func inc*(this: var JsBigInt) {.importjs: "(++[#][0][0])".} = runnableExamples: var big1: JsBigInt = big"1" inc big1 doAssert big1 == big"2" func dec*(this: var JsBigInt) {.importjs: "(--[#][0][0])".} = runnableExamples: var big1: JsBigInt = big"2" dec big1 doAssert big1 == big"1" func inc*(this: var JsBigInt; amount: JsBigInt) {.importjs: "([#][0][0] += #)".} = runnableExamples: var big1: JsBigInt = big"1" inc big1, big"2" doAssert big1 == big"3" func dec*(this: var JsBigInt; amount: JsBigInt) {.importjs: "([#][0][0] -= #)".} = runnableExamples: var big1: JsBigInt = big"1" dec big1, big"2" doAssert big1 == big"-1" func `+=`*(x: var JsBigInt; y: JsBigInt) {.importjs: "([#][0][0] $1 #)".} = runnableExamples: var big1: JsBigInt = big"1" big1 += big"2" doAssert big1 == big"3" func `-=`*(x: var JsBigInt; y: JsBigInt) {.importjs: "([#][0][0] $1 #)".} = runnableExamples: var big1: JsBigInt = big"1" big1 -= big"2" doAssert big1 == big"-1" func `*=`*(x: var JsBigInt; y: JsBigInt) {.importjs: "([#][0][0] $1 #)".} = runnableExamples: var big1: JsBigInt = big"2" big1 *= big"4" doAssert big1 == big"8" func `/=`*(x: var JsBigInt; y: JsBigInt) {.importjs: "([#][0][0] $1 #)".} = ## Same as `x = x div y`. runnableExamples: var big1: JsBigInt = big"11" big1 /= big"2" doAssert big1 == big"5" proc `+`*(_: JsBigInt): JsBigInt {.error: "See https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs".} # Can not be used by design ## **Do NOT use.** https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs proc low*(_: typedesc[JsBigInt]): JsBigInt {.error: "Arbitrary precision integers do not have a known low.".} ## **Do NOT use.** proc high*(_: typedesc[JsBigInt]): JsBigInt {.error: "Arbitrary precision integers do not have a known high.".} ## **Do NOT use.** runnableExamples: block: let big1: JsBigInt = big"2147483647" let big2: JsBigInt = big"666" doAssert JsBigInt isnot int doAssert big1 != big2 doAssert big1 > big2 doAssert big1 >= big2 doAssert big2 < big1 doAssert big2 <= big1 doAssert not(big1 == big2) let z = JsBigInt.default doAssert $z == "0n" block: var a: seq[JsBigInt] a.setLen 2 doAssert a == @[big"0", big"0"] doAssert a[^1] == big"0" var b: JsBigInt doAssert b == big"0" doAssert b == JsBigInt.default