mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
216 lines
No EOL
9.9 KiB
HTML
216 lines
No EOL
9.9 KiB
HTML
|
|
|
|
<!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">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>Development — Taboot v0.4.0 documentation</title>
|
|
<link rel="stylesheet" href="_static/default.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: '',
|
|
VERSION: '0.4.0',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<link rel="top" title="Taboot v0.4.0 documentation" href="index.html" />
|
|
</head>
|
|
<body>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="py-modindex.html" title="Python Module Index"
|
|
>modules</a> |</li>
|
|
<li><a href="index.html">Taboot v0.4.0 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="development">
|
|
<h1>Development<a class="headerlink" href="#development" title="Permalink to this headline">¶</a></h1>
|
|
<div class="section" id="tools">
|
|
<h2>Tools<a class="headerlink" href="#tools" title="Permalink to this headline">¶</a></h2>
|
|
<p>Taboot uses what is becoming a pretty standard and a quite simple
|
|
toolset.</p>
|
|
<div class="section" id="required-tools">
|
|
<h3>Required Tools<a class="headerlink" href="#required-tools" title="Permalink to this headline">¶</a></h3>
|
|
<blockquote>
|
|
<div><ol class="arabic simple">
|
|
<li><a class="reference external" href="http://www.python.org">python</a> - The python programming language</li>
|
|
<li><a class="reference external" href="http://docs.python.org/lib/module-distutils.html">distutils</a> - Python building and packaging library</li>
|
|
<li><a class="reference external" href="http://git.or.cz/">git</a> - Source code management</li>
|
|
<li><a class="reference external" href="https://fedorahosted.org/func/">Func</a> - The Fedora Unified Network Controller</li>
|
|
<li><a class="reference external" href="http://www.vim.org">an</a> <a class="reference external" href="http://www.gnu.org/software/emacs/">editor</a> or <a class="reference external" href="http://pida.co.uk/">ide</a> <a class="reference external" href="http://scribes.sourceforge.net/">that</a> doesn’t suck</li>
|
|
</ol>
|
|
</div></blockquote>
|
|
</div>
|
|
<div class="section" id="optional-tools">
|
|
<h3>Optional Tools<a class="headerlink" href="#optional-tools" title="Permalink to this headline">¶</a></h3>
|
|
<p>These should be available via your package manager:</p>
|
|
<blockquote>
|
|
<div><ol class="arabic simple">
|
|
<li><a class="reference external" href="http://www.rpm.org/max-rpm-snapshot/rpmbuild.8.html">rpm-build</a> - Should be packaged in your RPM distribution</li>
|
|
<li><a class="reference external" href="https://github.com/jcrocholl/pep8">pep8</a> - Check your patches for pep8 compliance with <tt class="docutils literal"><span class="pre">make</span> <span class="pre">pep8</span></tt></li>
|
|
</ol>
|
|
</div></blockquote>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="source">
|
|
<h2>Source<a class="headerlink" href="#source" title="Permalink to this headline">¶</a></h2>
|
|
<p>You can clone the repo via <strong class="program">git</strong> through the following command::</p>
|
|
<div class="highlight-python"><pre>$ git clone git://git.fedorahosted.org/Taboot.git</pre>
|
|
</div>
|
|
<p><span class="target" id="index-0"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-0008"><strong>PEP 0008</strong></a> should be followed. This outlines the highlights that we
|
|
require above and beyond. Your code must follow this (or note why it
|
|
can’t) before patches will be accepted.</p>
|
|
<blockquote>
|
|
<div><ul>
|
|
<li><p class="first">global variables should be in ALLCAPPS</p>
|
|
</li>
|
|
<li><p class="first">attributes should be all lowercase</p>
|
|
</li>
|
|
<li><p class="first">classes should be <tt class="docutils literal"><span class="pre">CamelCased</span></tt>, filenames should be <tt class="docutils literal"><span class="pre">lowercase</span></tt>.</p>
|
|
</li>
|
|
<li><p class="first">functions and methods should be lowercase with spaces replaced with _’s:</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">a_test_method</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
<span class="k">pass</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p class="first">classes should subclass <tt class="docutils literal"><span class="pre">object</span></tt> unless it subclasses a different object:</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Person</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
|
<span class="k">pass</span>
|
|
|
|
<span class="k">class</span> <span class="nc">Steve</span><span class="p">(</span><span class="n">Person</span><span class="p">):</span>
|
|
<span class="k">pass</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p class="first">4 spaces per indent level</p>
|
|
</li>
|
|
<li><p class="first">max length is 79 chars.</p>
|
|
</li>
|
|
<li><p class="first">single quotes preferred over double quotes.</p>
|
|
</li>
|
|
<li><p class="first">avoid <tt class="docutils literal"><span class="pre">from</span> <span class="pre">x</span> <span class="pre">import</span> <span class="pre">*</span></tt> imports unless a must use</p>
|
|
</li>
|
|
<li><p class="first">modules, functions, classes, and methods all must have docstrings - doc strings should be descriptive of what objects, functions, and methods do</p>
|
|
</li>
|
|
<li><p class="first">document any potentially confusing sections of code</p>
|
|
</li>
|
|
<li><p class="first">functions and methods should be broken down in such a way as to be easily understood and self contained</p>
|
|
</li>
|
|
<li><p class="first">use descriptive variable names, only use things like x, y, etc.. when doing integer loops and even then see if you can use more descriptive names</p>
|
|
</li>
|
|
</ul>
|
|
</div></blockquote>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">The <tt class="docutils literal"><span class="pre">Makefile</span></tt> included in the root of the source distribution
|
|
includes a target called <tt class="docutils literal"><span class="pre">pep8</span></tt>. Run <tt class="docutils literal"><span class="pre">make</span> <span class="pre">pep8</span></tt> to
|
|
automatically scan the <tt class="docutils literal"><span class="pre">taboot/</span></tt> subdirectory for violations.</p>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="id1">
|
|
<h2>Git<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
|
|
<p>The best way to develop on Taboot is to branch feature sets. For
|
|
instance, if you were to add xml deserialization you would want to
|
|
branch locally and work on that branch.:</p>
|
|
<div class="highlight-python"><pre> $ git branch
|
|
* master
|
|
$ git status
|
|
# On branch master
|
|
nothing to commit (working directory clean)
|
|
$ git branch xmldeserialization
|
|
$ git checkout xmldeserialization</pre>
|
|
</div>
|
|
<p>Now we pretend you are all finished and have done at least one commit to the xmldeserialization branch.:</p>
|
|
<div class="highlight-python"><pre>$ git-format-patch master
|
|
0001-created-initial-classes.patch
|
|
0002-added-in-documentation.patch
|
|
$</pre>
|
|
</div>
|
|
<p>You now have patch sets which you can send in for perusal and
|
|
acceptance. Open a new ticket in our issue tracker or attach them to
|
|
an existing ticket.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3><a href="index.html">Table Of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference internal" href="#">Development</a><ul>
|
|
<li><a class="reference internal" href="#tools">Tools</a><ul>
|
|
<li><a class="reference internal" href="#required-tools">Required Tools</a></li>
|
|
<li><a class="reference internal" href="#optional-tools">Optional Tools</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a class="reference internal" href="#source">Source</a></li>
|
|
<li><a class="reference internal" href="#id1">Git</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/development.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" size="18" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="py-modindex.html" title="Python Module Index"
|
|
>modules</a> |</li>
|
|
<li><a href="index.html">Taboot v0.4.0 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2009-2011 Red Hat, Inc.
|
|
Last updated on Mar 07, 2012.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
|
</div>
|
|
</body>
|
|
</html> |