summary refs log tree commit diff stats
path: root/doc/pydoc/os.path.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/pydoc/os.path.html')
-rw-r--r--doc/pydoc/os.path.html95
1 files changed, 95 insertions, 0 deletions
diff --git a/doc/pydoc/os.path.html b/doc/pydoc/os.path.html
new file mode 100644
index 00000000..a5b893f5
--- /dev/null
+++ b/doc/pydoc/os.path.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Python: module posixpath</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>posixpath</strong></big></big></font></td
+><td align=right valign=bottom
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python3.1/posixpath.py">/usr/lib/python3.1/posixpath.py</a><br><a href="http://docs.python.org/library/posixpath">Module Docs</a></font></td></tr></table>
+    <p><tt>Common&nbsp;operations&nbsp;on&nbsp;Posix&nbsp;pathnames.<br>
+&nbsp;<br>
+Instead&nbsp;of&nbsp;importing&nbsp;this&nbsp;module&nbsp;directly,&nbsp;import&nbsp;os&nbsp;and&nbsp;refer&nbsp;to<br>
+this&nbsp;module&nbsp;as&nbsp;os.path.&nbsp;&nbsp;The&nbsp;"os.path"&nbsp;name&nbsp;is&nbsp;an&nbsp;alias&nbsp;for&nbsp;this<br>
+module&nbsp;on&nbsp;Posix&nbsp;systems;&nbsp;on&nbsp;other&nbsp;systems&nbsp;(e.g.&nbsp;Mac,&nbsp;Windows),<br>
+os.path&nbsp;provides&nbsp;the&nbsp;same&nbsp;operations&nbsp;in&nbsp;a&nbsp;manner&nbsp;specific&nbsp;to&nbsp;that<br>
+platform,&nbsp;and&nbsp;is&nbsp;an&nbsp;alias&nbsp;to&nbsp;another&nbsp;module&nbsp;(e.g.&nbsp;macpath,&nbsp;ntpath).<br>
+&nbsp;<br>
+Some&nbsp;of&nbsp;this&nbsp;can&nbsp;actually&nbsp;be&nbsp;useful&nbsp;on&nbsp;non-Posix&nbsp;systems&nbsp;too,&nbsp;e.g.<br>
+for&nbsp;manipulation&nbsp;of&nbsp;the&nbsp;pathname&nbsp;component&nbsp;of&nbsp;URLs.</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="genericpath.html">genericpath</a><br>
+</td><td width="25%" valign=top><a href="os.html">os</a><br>
+</td><td width="25%" valign=top><a href="stat.html">stat</a><br>
+</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
+</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="-abspath"><strong>abspath</strong></a>(path)</dt><dd><tt>Return&nbsp;an&nbsp;absolute&nbsp;path.</tt></dd></dl>
+ <dl><dt><a name="-basename"><strong>basename</strong></a>(p)</dt><dd><tt>Returns&nbsp;the&nbsp;final&nbsp;component&nbsp;of&nbsp;a&nbsp;pathname</tt></dd></dl>
+ <dl><dt><a name="-commonprefix"><strong>commonprefix</strong></a>(m)</dt><dd><tt>Given&nbsp;a&nbsp;list&nbsp;of&nbsp;pathnames,&nbsp;returns&nbsp;the&nbsp;longest&nbsp;common&nbsp;leading&nbsp;component</tt></dd></dl>
+ <dl><dt><a name="-dirname"><strong>dirname</strong></a>(p)</dt><dd><tt>Returns&nbsp;the&nbsp;directory&nbsp;component&nbsp;of&nbsp;a&nbsp;pathname</tt></dd></dl>
+ <dl><dt><a name="-exists"><strong>exists</strong></a>(path)</dt><dd><tt>Test&nbsp;whether&nbsp;a&nbsp;path&nbsp;exists.&nbsp;&nbsp;Returns&nbsp;False&nbsp;for&nbsp;broken&nbsp;symbolic&nbsp;links</tt></dd></dl>
+ <dl><dt><a name="-expanduser"><strong>expanduser</strong></a>(path)</dt><dd><tt>Expand&nbsp;~&nbsp;and&nbsp;~user&nbsp;constructions.&nbsp;&nbsp;If&nbsp;user&nbsp;or&nbsp;$HOME&nbsp;is&nbsp;unknown,<br>
+do&nbsp;nothing.</tt></dd></dl>
+ <dl><dt><a name="-expandvars"><strong>expandvars</strong></a>(path)</dt><dd><tt>Expand&nbsp;shell&nbsp;variables&nbsp;of&nbsp;form&nbsp;$var&nbsp;and&nbsp;${var}.&nbsp;&nbsp;Unknown&nbsp;variables<br>
+are&nbsp;left&nbsp;unchanged.</tt></dd></dl>
+ <dl><dt><a name="-getatime"><strong>getatime</strong></a>(filename)</dt><dd><tt>Return&nbsp;the&nbsp;last&nbsp;access&nbsp;time&nbsp;of&nbsp;a&nbsp;file,&nbsp;reported&nbsp;by&nbsp;os.stat().</tt></dd></dl>
+ <dl><dt><a name="-getctime"><strong>getctime</strong></a>(filename)</dt><dd><tt>Return&nbsp;the&nbsp;metadata&nbsp;change&nbsp;time&nbsp;of&nbsp;a&nbsp;file,&nbsp;reported&nbsp;by&nbsp;os.stat().</tt></dd></dl>
+ <dl><dt><a name="-getmtime"><strong>getmtime</strong></a>(filename)</dt><dd><tt>Return&nbsp;the&nbsp;last&nbsp;modification&nbsp;time&nbsp;of&nbsp;a&nbsp;file,&nbsp;reported&nbsp;by&nbsp;os.stat().</tt></dd></dl>
+ <dl><dt><a name="-getsize"><strong>getsize</strong></a>(filename)</dt><dd><tt>Return&nbsp;the&nbsp;size&nbsp;of&nbsp;a&nbsp;file,&nbsp;reported&nbsp;by&nbsp;os.stat().</tt></dd></dl>
+ <dl><dt><a name="-isabs"><strong>isabs</strong></a>(s)</dt><dd><tt>Test&nbsp;whether&nbsp;a&nbsp;path&nbsp;is&nbsp;absolute</tt></dd></dl>
+ <dl><dt><a name="-isdir"><strong>isdir</strong></a>(s)</dt><dd><tt>Return&nbsp;true&nbsp;if&nbsp;the&nbsp;pathname&nbsp;refers&nbsp;to&nbsp;an&nbsp;existing&nbsp;directory.</tt></dd></dl>
+ <dl><dt><a name="-isfile"><strong>isfile</strong></a>(path)</dt><dd><tt>Test&nbsp;whether&nbsp;a&nbsp;path&nbsp;is&nbsp;a&nbsp;regular&nbsp;file</tt></dd></dl>
+ <dl><dt><a name="-islink"><strong>islink</strong></a>(path)</dt><dd><tt>Test&nbsp;whether&nbsp;a&nbsp;path&nbsp;is&nbsp;a&nbsp;symbolic&nbsp;link</tt></dd></dl>
+ <dl><dt><a name="-ismount"><strong>ismount</strong></a>(path)</dt><dd><tt>Test&nbsp;whether&nbsp;a&nbsp;path&nbsp;is&nbsp;a&nbsp;mount&nbsp;point</tt></dd></dl>
+ <dl><dt><a name="-join"><strong>join</strong></a>(a, *p)</dt><dd><tt>Join&nbsp;two&nbsp;or&nbsp;more&nbsp;pathname&nbsp;components,&nbsp;inserting&nbsp;'/'&nbsp;as&nbsp;needed.<br>
+If&nbsp;any&nbsp;component&nbsp;is&nbsp;an&nbsp;absolute&nbsp;path,&nbsp;all&nbsp;previous&nbsp;path&nbsp;components<br>
+will&nbsp;be&nbsp;discarded.</tt></dd></dl>
+ <dl><dt><a name="-lexists"><strong>lexists</strong></a>(path)</dt><dd><tt>Test&nbsp;whether&nbsp;a&nbsp;path&nbsp;exists.&nbsp;&nbsp;Returns&nbsp;True&nbsp;for&nbsp;broken&nbsp;symbolic&nbsp;links</tt></dd></dl>
+ <dl><dt><a name="-normcase"><strong>normcase</strong></a>(s)</dt><dd><tt>Normalize&nbsp;case&nbsp;of&nbsp;pathname.&nbsp;&nbsp;Has&nbsp;no&nbsp;effect&nbsp;under&nbsp;Posix</tt></dd></dl>
+ <dl><dt><a name="-normpath"><strong>normpath</strong></a>(path)</dt><dd><tt>Normalize&nbsp;path,&nbsp;eliminating&nbsp;double&nbsp;slashes,&nbsp;etc.</tt></dd></dl>
+ <dl><dt><a name="-realpath"><strong>realpath</strong></a>(filename)</dt><dd><tt>Return&nbsp;the&nbsp;canonical&nbsp;path&nbsp;of&nbsp;the&nbsp;specified&nbsp;filename,&nbsp;eliminating&nbsp;any<br>
+symbolic&nbsp;links&nbsp;encountered&nbsp;in&nbsp;the&nbsp;path.</tt></dd></dl>
+ <dl><dt><a name="-relpath"><strong>relpath</strong></a>(path, start<font color="#909090">=None</font>)</dt><dd><tt>Return&nbsp;a&nbsp;relative&nbsp;version&nbsp;of&nbsp;a&nbsp;path</tt></dd></dl>
+ <dl><dt><a name="-samefile"><strong>samefile</strong></a>(f1, f2)</dt><dd><tt>Test&nbsp;whether&nbsp;two&nbsp;pathnames&nbsp;reference&nbsp;the&nbsp;same&nbsp;actual&nbsp;file</tt></dd></dl>
+ <dl><dt><a name="-sameopenfile"><strong>sameopenfile</strong></a>(fp1, fp2)</dt><dd><tt>Test&nbsp;whether&nbsp;two&nbsp;open&nbsp;file&nbsp;objects&nbsp;reference&nbsp;the&nbsp;same&nbsp;file</tt></dd></dl>
+ <dl><dt><a name="-samestat"><strong>samestat</strong></a>(s1, s2)</dt><dd><tt>Test&nbsp;whether&nbsp;two&nbsp;stat&nbsp;buffers&nbsp;reference&nbsp;the&nbsp;same&nbsp;file</tt></dd></dl>
+ <dl><dt><a name="-split"><strong>split</strong></a>(p)</dt><dd><tt>Split&nbsp;a&nbsp;pathname.&nbsp;&nbsp;Returns&nbsp;tuple&nbsp;"(head,&nbsp;tail)"&nbsp;where&nbsp;"tail"&nbsp;is<br>
+everything&nbsp;after&nbsp;the&nbsp;final&nbsp;slash.&nbsp;&nbsp;Either&nbsp;part&nbsp;may&nbsp;be&nbsp;empty.</tt></dd></dl>
+ <dl><dt><a name="-splitdrive"><strong>splitdrive</strong></a>(p)</dt><dd><tt>Split&nbsp;a&nbsp;pathname&nbsp;into&nbsp;drive&nbsp;and&nbsp;path.&nbsp;On&nbsp;Posix,&nbsp;drive&nbsp;is&nbsp;always<br>
+empty.</tt></dd></dl>
+ <dl><dt><a name="-splitext"><strong>splitext</strong></a>(p)</dt><dd><tt>Split&nbsp;the&nbsp;extension&nbsp;from&nbsp;a&nbsp;pathname.<br>
+&nbsp;<br>
+Extension&nbsp;is&nbsp;everything&nbsp;from&nbsp;the&nbsp;last&nbsp;dot&nbsp;to&nbsp;the&nbsp;end,&nbsp;ignoring<br>
+leading&nbsp;dots.&nbsp;&nbsp;Returns&nbsp;"(root,&nbsp;ext)";&nbsp;ext&nbsp;may&nbsp;be&nbsp;empty.</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>__all__</strong> = ['normcase', 'isabs', 'join', 'splitdrive', 'split', 'splitext', 'basename', 'dirname', 'commonprefix', 'getsize', 'getmtime', 'getatime', 'getctime', 'islink', 'exists', 'lexists', 'isdir', 'isfile', 'ismount', 'expanduser', ...]<br>
+<strong>altsep</strong> = None<br>
+<strong>curdir</strong> = '.'<br>
+<strong>defpath</strong> = ':/bin:/usr/bin'<br>
+<strong>devnull</strong> = '/dev/null'<br>
+<strong>extsep</strong> = '.'<br>
+<strong>pardir</strong> = '..'<br>
+<strong>pathsep</strong> = ':'<br>
+<strong>sep</strong> = '/'<br>
+<strong>supports_unicode_filenames</strong> = False</td></tr></table>
+</body></html>
\ No newline at end of file
an class="nv">copy four { mandelbrot screen scene-cx, scene-cy, scene-width # move the center some % of the current screen-width var adj/xmm0: float <- rational 2, 0x1c/28 adj <- multiply scene-width scene-cx <- subtract adj scene-cy <- add adj # slowly shrink the scene width to zoom in scene-width <- multiply scene-width-scale loop } } fn mandelbrot screen: (addr screen), scene-cx: float, scene-cy: float, scene-width: float { var a/eax: int <- copy 0 var b/ecx: int <- copy 0 a, b <- screen-size screen var width/esi: int <- copy a width <- shift-left 3/log2-font-width var height/edi: int <- copy b height <- shift-left 4/log2-font-height var y/ecx: int <- copy 0 { compare y, height break-if->= var imaginary/xmm1: float <- viewport-to-imaginary y, width, height, scene-cy, scene-width var x/ebx: int <- copy 0 { compare x, width break-if->= var real/xmm0: float <- viewport-to-real x, width, scene-cx, scene-width var iterations/eax: int <- mandelbrot-iterations-for-point real, imaginary, 0x400/max iterations <- shift-right 3 var color/edx: int <- copy 0 iterations, color <- integer-divide iterations, 0x18/24/size-of-cycle-0 color <- add 0x20/cycle-0 pixel screen, x, y, color x <- increment loop } y <- increment loop } } fn mandelbrot-iterations-for-point real: float, imaginary: float, max: int -> _/eax: int { var zero: float var x/xmm0: float <- copy zero var y/xmm1: float <- copy zero var iterations/ecx: int <- copy 0 { var done?/eax: boolean <- mandelbrot-done? x, y compare done?, 0/false break-if-!= compare iterations, max break-if->= var newx/xmm2: float <- mandelbrot-x x, y, real var newy/xmm3: float <- mandelbrot-y x, y, imaginary x <- copy newx y <- copy newy iterations <- increment loop } return iterations } fn mandelbrot-done? x: float, y: float -> _/eax: boolean { # x*x + y*y > 4 var x2/xmm0: float <- copy x x2 <- multiply x var y2/xmm1: float <- copy y y2 <- multiply y var sum/xmm0: float <- copy x2 sum <- add y2 var four/eax: int <- copy 4 var four-f/xmm1: float <- convert four compare sum, four-f { break-if-float> return 0/false } return 1/true } fn mandelbrot-x x: float, y: float, real: float -> _/xmm2: float { # x*x - y*y + real var x2/xmm0: float <- copy x x2 <- multiply x var y2/xmm1: float <- copy y y2 <- multiply y var result/xmm0: float <- copy x2 result <- subtract y2 result <- add real return result } fn mandelbrot-y x: float, y: float, imaginary: float -> _/xmm3: float { # 2*x*y + imaginary var two/eax: int <- copy 2 var result/xmm0: float <- convert two result <- multiply x result <- multiply y result <- add imaginary return result } # Scale (x, y) pixel coordinates to a complex plane where the viewport width # ranges from -2 to +2. Viewport height just follows the viewport's aspect # ratio. fn viewport-to-real x: int, width: int, scene-cx: float, scene-width: float -> _/xmm0: float { # 0 in the viewport goes to scene-cx - scene-width/2 # width in the viewport goes to scene-cx + scene-width/2 # Therefore: # x in the viewport goes to (scene-cx - scene-width/2) + x*scene-width/width # At most two numbers being multiplied before a divide, so no risk of overflow. var result/xmm0: float <- convert x result <- multiply scene-width var width-f/xmm1: float <- convert width result <- divide width-f result <- add scene-cx var two/eax: int <- copy 2 var two-f/xmm2: float <- convert two var half-scene-width/xmm1: float <- copy scene-width half-scene-width <- divide two-f result <- subtract half-scene-width return result } fn viewport-to-imaginary y: int, width: int, height: int, scene-cy: float, scene-width: float -> _/xmm1: float { # 0 in the viewport goes to scene-cy - scene-width/2*height/width # height in the viewport goes to scene-cy + scene-width/2*height/width # Therefore: # y in the viewport goes to (scene-cy - scene-width/2*height/width) + y*scene-width/width # scene-cy - scene-width/width * (height/2 + y) # At most two numbers being multiplied before a divide, so no risk of overflow. var result/xmm0: float <- convert y result <- multiply scene-width var width-f/xmm1: float <- convert width result <- divide width-f result <- add scene-cy var two/eax: int <- copy 2 var two-f/xmm2: float <- convert two var second-term/xmm1: float <- copy scene-width second-term <- divide two-f var height-f/xmm2: float <- convert height second-term <- multiply height-f var width-f/xmm2: float <- convert width second-term <- divide width-f result <- subtract second-term return result }