This file is indexed.

/usr/share/doc/pyqi/html/tutorials/organizing_your_repository.html is in pyqi 0.3.2+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!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=cp1252" />
    
    <title>Organizing your repository</title>
    
    <link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="top" title="pyqi: expose your interface" href="../index.html" /> 
  </head>
  <body>
      <div class="header"><h1 class="heading"><a href="../index.html">
          <span>pyqi: expose your interface</span></a></h1>
        <h2 class="heading"><span>Organizing your repository</span></h2>
      </div>
      <div class="topnav">
      
        <p>
        <a class="uplink" href="../index.html">Contents</a>
        </p>

      </div>
      <div class="content">
        
        
  <div class="section" id="organizing-your-repository">
<span id="id1"></span><h1>Organizing your repository</h1>
<p>This document covers suggestions for organizing your repository to align with how pyqi and projects that use pyqi are organized. Following these guidelines is not a requirement, but may simplify using pyqi in your project. Version 1.1.3 of the <a class="reference external" href="http://www.biom-format.org">biom-format</a> project was the first project to use pyqi for its commands and interfaces, so the structure of that repository is used as an example here.</p>
<div class="section" id="structure-of-the-biom-format-project">
<h2>Structure of the biom-format project</h2>
<p>This directory tree (created with the unix <tt class="docutils literal"><span class="pre">tree</span></tt> command) illustrates the structure of the biom-format repository (some files that are not relevant to this discussion have been omitted to keep this as simple as possible). Annotations have been added following <tt class="docutils literal"><span class="pre">##</span></tt> to reference specific directories.</p>
<div class="highlight-python"><div class="highlight"><pre>biom-format/
&#9500;&#9472;&#9472; ChangeLog
&#9500;&#9472;&#9472; COPYING
&#9500;&#9472;&#9472; doc
&#9500;&#9472;&#9472; examples
&#9500;&#9472;&#9472; images
&#9500;&#9472;&#9472; INSTALL
&#9500;&#9472;&#9472; python-code
&#9474;   &#9500;&#9472;&#9472; biom ## Library code directory
&#9474;   &#9474;   &#9500;&#9472;&#9472; biomdb.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; commands ## derived Command classes
&#9474;   &#9474;   &#9474;   &#9500;&#9472;&#9472; __init__.py
&#9474;   &#9474;   &#9474;   &#9500;&#9472;&#9472; installation_informer.py
&#9474;   &#9474;   &#9474;   &#9500;&#9472;&#9472; metadata_adder.py
&#9474;   &#9474;   &#9474;   &#9500;&#9472;&#9472; table_subsetter.py
&#9474;   &#9474;   &#9474;   &#9500;&#9472;&#9472; table_summarizer.py
&#9474;   &#9474;   &#9474;   &#9492;&#9472;&#9472; table_validator.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; csmat.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; dbdata.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; exception.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; __init__.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; interfaces ## per-interface-type directories
&#9474;   &#9474;   &#9474;   &#9500;&#9472;&#9472; __init__.py
&#9474;   &#9474;   &#9474;   &#9492;&#9472;&#9472; optparse ## derived OptparseInterface classes
&#9474;   &#9474;   &#9474;       &#9500;&#9472;&#9472; config
&#9474;   &#9474;   &#9474;       &#9474;   &#9500;&#9472;&#9472; add_metadata.py
&#9474;   &#9474;   &#9474;       &#9474;   &#9500;&#9472;&#9472; __init__.py
&#9474;   &#9474;   &#9474;       &#9474;   &#9500;&#9472;&#9472; show_install_info.py
&#9474;   &#9474;   &#9474;       &#9474;   &#9500;&#9472;&#9472; subset_table.py
&#9474;   &#9474;   &#9474;       &#9474;   &#9500;&#9472;&#9472; summarize_table.py
&#9474;   &#9474;   &#9474;       &#9474;   &#9492;&#9472;&#9472; validate_table.py
&#9474;   &#9474;   &#9474;       &#9500;&#9472;&#9472; __init__.py
&#9474;   &#9474;   &#9474;       &#9500;&#9472;&#9472; input_handler.py ## general purpose OptparseInterface input handler functions
&#9474;   &#9474;   &#9474;       &#9492;&#9472;&#9472; output_handler.py ## general purpose OptparseInterface output handler functions
&#9474;   &#9474;   &#9500;&#9472;&#9472; parse.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; sparsedict.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; sparsemat.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; table.py
&#9474;   &#9474;   &#9500;&#9472;&#9472; unit_test.py
&#9474;   &#9474;   &#9492;&#9472;&#9472; util.py
&#9474;   &#9500;&#9472;&#9472; support-code
&#9474;   &#9492;&#9472;&#9472; tests ## Test code directory
&#9474;       &#9500;&#9472;&#9472; bench
&#9474;       &#9500;&#9472;&#9472; __init__.py
&#9474;       &#9500;&#9472;&#9472; test_biomdb.py
&#9474;       &#9500;&#9472;&#9472; test_commands # unit tests of the derived Command classes
&#9474;       &#9474;   &#9500;&#9472;&#9472; __init__.py
&#9474;       &#9474;   &#9500;&#9472;&#9472; test_installation_informer.py
&#9474;       &#9474;   &#9500;&#9472;&#9472; test_metadata_adder.py
&#9474;       &#9474;   &#9500;&#9472;&#9472; test_table_subsetter.py
&#9474;       &#9474;   &#9500;&#9472;&#9472; test_table_summarizer.py
&#9474;       &#9474;   &#9492;&#9472;&#9472; test_table_validator.py
&#9474;       &#9500;&#9472;&#9472; test_csmat.py
&#9474;       &#9500;&#9472;&#9472; test_dbdata.py
&#9474;       &#9500;&#9472;&#9472; test_interfaces # unit tests of input and output handlers
&#9474;       &#9474;   &#9500;&#9472;&#9472; __init__.py
&#9474;       &#9474;   &#9500;&#9472;&#9472; test_optparse
&#9474;   &#9474;   &#9474;       &#9500;&#9472;&#9472; __init__.py
&#9474;   &#9474;   &#9474;       &#9500;&#9472;&#9472; test_input_handler.py ## tests of OptparseInterface input handler functions
&#9474;   &#9474;   &#9474;       &#9492;&#9472;&#9472; test_output_handler.py ## tests of OptparseInterface output handler functions
&#9474;       &#9500;&#9472;&#9472; test_parse.py
&#9474;       &#9500;&#9472;&#9472; test_sparsedict.py
&#9474;       &#9500;&#9472;&#9472; test_sparsemat.py
&#9474;       &#9500;&#9472;&#9472; test_table.py
&#9474;       &#9500;&#9472;&#9472; test_unit_test.py
&#9474;       &#9492;&#9472;&#9472; test_util.py
&#9500;&#9472;&#9472; R-code
&#9500;&#9472;&#9472; README.md
&#9500;&#9472;&#9472; scripts
&#9474;   &#9492;&#9472;&#9472; biom ## biom command driver
&#9500;&#9472;&#9472; setup.py
&#9492;&#9472;&#9472; support_files
</pre></div>
</div>
</div>
<div class="section" id="discussion-of-the-biom-format-directory-structure">
<h2>Discussion of the biom-format directory structure</h2>
<p>Under the <tt class="docutils literal"><span class="pre">biom</span></tt> <em>library code directory</em>, there are two directories that house pyqi-related code. The first is <tt class="docutils literal"><span class="pre">commands</span></tt>, which contains derivations of the <tt class="docutils literal"><span class="pre">Command</span></tt> class (see <a class="reference internal" href="defining_new_commands.html#defining-new-commands"><em>Defining new commands</em></a> for discussion of these files). All of the <tt class="docutils literal"><span class="pre">biom-format</span></tt> commands are therefore defined in this directory. The second is <tt class="docutils literal"><span class="pre">interfaces</span></tt>, which contains all of the derivations of the pyqi <tt class="docutils literal"><span class="pre">Interface</span></tt> class, and which are nested based on interface type. Currently <tt class="docutils literal"><span class="pre">biom-format</span></tt> only implements <tt class="docutils literal"><span class="pre">OptparseInterface</span></tt> classes, so there is only an <tt class="docutils literal"><span class="pre">optparse</span></tt> directory, but by nesting these on an per-interface-type basis we avoid name conflicts if multiple interfaces types were defined.</p>
<p>Under the <tt class="docutils literal"><span class="pre">biom/interfaces/optparse</span></tt> directory, there is a <tt class="docutils literal"><span class="pre">config</span></tt> directory which contains all of the config files (see <a class="reference internal" href="defining_new_interfaces.html#defining-new-interfaces"><em>Defining new interfaces</em></a> for discussion of these files). There are also top-level <tt class="docutils literal"><span class="pre">input_handler.py</span></tt> and <tt class="docutils literal"><span class="pre">output_handler.py</span></tt> files. These files contain general purpose input and output handlers that may be used in multiple <tt class="docutils literal"><span class="pre">OptparseInterfaces</span></tt>. Since input and output handlers are interface specific, it makes sense for these files to be contained under the <tt class="docutils literal"><span class="pre">biom/interfaces/optparse</span></tt> directory.</p>
<p>Under the <tt class="docutils literal"><span class="pre">tests</span></tt> directory there are subdirectories for <tt class="docutils literal"><span class="pre">test_commands</span></tt> and <tt class="docutils literal"><span class="pre">test_interfaces</span></tt>. The <tt class="docutils literal"><span class="pre">test_commands</span></tt> directory should contain a file corresponding to each file in the <tt class="docutils literal"><span class="pre">biom/commands</span></tt> directory, and should provide extensive unit testing of each of your commands. The <tt class="docutils literal"><span class="pre">test_interfaces</span></tt> directory is more minimal as typically there is not any functionality in the interfaces (the files are just providing configuration details). The exception is the input and output handlers, so there are test files corresponding to the files where those are defined. Note that the nesting of all test files matches the nesting in the library code directory.</p>
<p>Finally, under the <tt class="docutils literal"><span class="pre">scripts</span></tt> directory there is a single executable, <tt class="docutils literal"><span class="pre">biom</span></tt>, which is the <tt class="docutils literal"><span class="pre">OptparseInterface</span></tt> command driver. This is a simple shell script that allows users to access the <tt class="docutils literal"><span class="pre">OptparseInterfaces</span></tt> defined in the <tt class="docutils literal"><span class="pre">biom-format</span></tt> project. Defining this script for your project is covered in <a class="reference internal" href="defining_your_command_driver.html#defining-your-command-driver"><em>Defining your command driver</em></a>.</p>
</div>
</div>


      </div>
      <div class="bottomnav">
      
        <p>
        <a class="uplink" href="../index.html">Contents</a>
        </p>

      </div>

    <div class="footer">
        &copy; Copyright 2013, The BiPy Development Team.
      Last updated on May 22, 2014.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
    </div>
  </body>
</html>