| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="dist.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="dist.html" title='Distributing Python Modules' /> |
| 8 | <link rel='index' href='genindex.html' title='Index' /> |
| 9 | <link rel='last' href='about.html' title='About this document...' /> |
| 10 | <link rel='help' href='about.html' title='About this document...' /> |
| 11 | <link rel="next" href="reference.html" /> |
| 12 | <link rel="prev" href="examples.html" /> |
| 13 | <link rel="parent" href="dist.html" /> |
| 14 | <link rel="next" href="node29.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>8. Extending Distutils </title> |
| 17 | </head> |
| 18 | <body> |
| 19 | <DIV CLASS="navigation"> |
| 20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 22 | <tr> |
| 23 | <td class='online-navigation'><a rel="prev" title="7.3 Single extension module" |
| 24 | href="single-ext.html"><img src='../icons/previous.png' |
| 25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 26 | <td class='online-navigation'><a rel="parent" title="Distributing Python Modules" |
| 27 | href="dist.html"><img src='../icons/up.png' |
| 28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 29 | <td class='online-navigation'><a rel="next" title="8.1 Integrating new commands" |
| 30 | href="node29.html"><img src='../icons/next.png' |
| 31 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 32 | <td align="center" width="100%">Distributing Python Modules</td> |
| 33 | <td class='online-navigation'><img src='../icons/blank.png' |
| 34 | border='0' height='32' alt='' width='32' /></td> |
| 35 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 36 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 37 | <td class='online-navigation'><a rel="index" title="Index" |
| 38 | href="genindex.html"><img src='../icons/index.png' |
| 39 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 40 | </tr></table> |
| 41 | <div class='online-navigation'> |
| 42 | <b class="navlabel">Previous:</b> |
| 43 | <a class="sectref" rel="prev" href="single-ext.html">7.3 Single extension module</A> |
| 44 | <b class="navlabel">Up:</b> |
| 45 | <a class="sectref" rel="parent" href="dist.html">Distributing Python Modules</A> |
| 46 | <b class="navlabel">Next:</b> |
| 47 | <a class="sectref" rel="next" href="node29.html">8.1 Integrating new commands</A> |
| 48 | </div> |
| 49 | <hr /></div> |
| 50 | </DIV> |
| 51 | <!--End of Navigation Panel--> |
| 52 | |
| 53 | <H1><A NAME="SECTION008000000000000000000"></A><A NAME="extending"></A> |
| 54 | <BR> |
| 55 | 8. Extending Distutils |
| 56 | </H1> |
| 57 | |
| 58 | <P> |
| 59 | Distutils can be extended in various ways. Most extensions take the |
| 60 | form of new commands or replacements for existing commands. New |
| 61 | commands may be written to support new types of platform-specific |
| 62 | packaging, for example, while replacements for existing commands may |
| 63 | be made to modify details of how the command operates on a package. |
| 64 | |
| 65 | <P> |
| 66 | Most extensions of the distutils are made within <span class="file">setup.py</span> |
| 67 | scripts that want to modify existing commands; many simply add a few |
| 68 | file extensions that should be copied into packages in addition to |
| 69 | <span class="file">.py</span> files as a convenience. |
| 70 | |
| 71 | <P> |
| 72 | Most distutils command implementations are subclasses of the |
| 73 | <tt class="class">Command</tt> class from <tt class="module"><a href="module-distutils.cmd.html">distutils.cmd</a></tt>. New commands |
| 74 | may directly inherit from <tt class="class">Command</tt>, while replacements often |
| 75 | derive from <tt class="class">Command</tt> indirectly, directly subclassing the |
| 76 | command they are replacing. Commands are required to derive from |
| 77 | <tt class="class">Command</tt>. |
| 78 | |
| 79 | <P> |
| 80 | |
| 81 | <p><br /></p><hr class='online-navigation' /> |
| 82 | <div class='online-navigation'> |
| 83 | <!--Table of Child-Links--> |
| 84 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> |
| 85 | |
| 86 | <UL CLASS="ChildLinks"> |
| 87 | <LI><A href="node29.html">8.1 Integrating new commands</a> |
| 88 | </ul> |
| 89 | <!--End of Table of Child-Links--> |
| 90 | </div> |
| 91 | |
| 92 | <DIV CLASS="navigation"> |
| 93 | <div class='online-navigation'> |
| 94 | <p></p><hr /> |
| 95 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 96 | <tr> |
| 97 | <td class='online-navigation'><a rel="prev" title="7.3 Single extension module" |
| 98 | href="single-ext.html"><img src='../icons/previous.png' |
| 99 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 100 | <td class='online-navigation'><a rel="parent" title="Distributing Python Modules" |
| 101 | href="dist.html"><img src='../icons/up.png' |
| 102 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 103 | <td class='online-navigation'><a rel="next" title="8.1 Integrating new commands" |
| 104 | href="node29.html"><img src='../icons/next.png' |
| 105 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 106 | <td align="center" width="100%">Distributing Python Modules</td> |
| 107 | <td class='online-navigation'><img src='../icons/blank.png' |
| 108 | border='0' height='32' alt='' width='32' /></td> |
| 109 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 110 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 111 | <td class='online-navigation'><a rel="index" title="Index" |
| 112 | href="genindex.html"><img src='../icons/index.png' |
| 113 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 114 | </tr></table> |
| 115 | <div class='online-navigation'> |
| 116 | <b class="navlabel">Previous:</b> |
| 117 | <a class="sectref" rel="prev" href="single-ext.html">7.3 Single extension module</A> |
| 118 | <b class="navlabel">Up:</b> |
| 119 | <a class="sectref" rel="parent" href="dist.html">Distributing Python Modules</A> |
| 120 | <b class="navlabel">Next:</b> |
| 121 | <a class="sectref" rel="next" href="node29.html">8.1 Integrating new commands</A> |
| 122 | </div> |
| 123 | </div> |
| 124 | <hr /> |
| 125 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 126 | </DIV> |
| 127 | <!--End of Navigation Panel--> |
| 128 | <ADDRESS> |
| 129 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 130 | </ADDRESS> |
| 131 | </BODY> |
| 132 | </HTML> |