doc/api/python/configuration.PropertiesConfiguration-class.html
changeset 432 f2ddfa555b0f
equal deleted inserted replaced
431:7685cec9fd3c 432:f2ddfa555b0f
       
     1 <?xml version="1.0" encoding="ascii"?>
       
     2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       
     3           "DTD/xhtml1-transitional.dtd">
       
     4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
       
     5 <head>
       
     6   <title>configuration.PropertiesConfiguration</title>
       
     7   <link rel="stylesheet" href="epydoc.css" type="text/css" />
       
     8   <script type="text/javascript" src="epydoc.js"></script>
       
     9 </head>
       
    10 
       
    11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
       
    12       alink="#204080">
       
    13 <!-- ==================== NAVIGATION BAR ==================== -->
       
    14 <table class="navbar" border="0" width="100%" cellpadding="0"
       
    15        bgcolor="#a0c0ff" cellspacing="0">
       
    16   <tr valign="middle">
       
    17 
       
    18   <!-- Tree link -->
       
    19       <th>&nbsp;&nbsp;&nbsp;<a
       
    20         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
       
    21 
       
    22   <!-- Index link -->
       
    23       <th>&nbsp;&nbsp;&nbsp;<a
       
    24         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
       
    25 
       
    26   <!-- Help link -->
       
    27       <th>&nbsp;&nbsp;&nbsp;<a
       
    28         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
       
    29 
       
    30       <th class="navbar" width="100%"></th>
       
    31   </tr>
       
    32 </table>
       
    33 <table width="100%" cellpadding="0" cellspacing="0">
       
    34   <tr valign="top">
       
    35     <td width="100%">
       
    36       <span class="breadcrumbs">
       
    37         <a href="configuration-module.html">Module&nbsp;configuration</a> ::
       
    38         Class&nbsp;PropertiesConfiguration
       
    39       </span>
       
    40     </td>
       
    41     <td>
       
    42       <table cellpadding="0" cellspacing="0">
       
    43         <!-- hide/show private -->
       
    44         <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
       
    45     onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
       
    46         <tr><td align="right"><span class="options"
       
    47             >[<a href="frames.html" target="_top">frames</a
       
    48             >]&nbsp;|&nbsp;<a href="configuration.PropertiesConfiguration-class.html"
       
    49             target="_top">no&nbsp;frames</a>]</span></td></tr>
       
    50       </table>
       
    51     </td>
       
    52   </tr>
       
    53 </table>
       
    54 <!-- ==================== CLASS DESCRIPTION ==================== -->
       
    55 <h1 class="epydoc">Class PropertiesConfiguration</h1><span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration">source&nbsp;code</a></span><br /><br />
       
    56 <pre class="base-tree">
       
    57             object --+    
       
    58                      |    
       
    59 UserDict.DictMixin --+    
       
    60                      |    
       
    61          <a href="configuration.Configuration-class.html">Configuration</a> --+
       
    62                          |
       
    63                         <strong class="uidshort">PropertiesConfiguration</strong>
       
    64 </pre>
       
    65 
       
    66 <hr />
       
    67 <p>A Configuration that parses a plain text properties file.</p>
       
    68 <p>This typically follows the java.util.Properties format.</p>
       
    69 <p>Note: This code is mostly based on this recipe
       
    70 <a class="rst-reference external" href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496795" target="_top">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496795</a>.
       
    71 Copyright (c) Anand Balachandran Pillai</p><br /><br />
       
    72 
       
    73 <!-- ==================== INSTANCE METHODS ==================== -->
       
    74 <a name="section-InstanceMethods"></a>
       
    75 <table class="summary" border="1" cellpadding="3"
       
    76        cellspacing="0" width="100%" bgcolor="white">
       
    77 <tr bgcolor="#70b0f0" class="table-header">
       
    78   <td colspan="2" class="table-header">
       
    79     <table border="0" cellpadding="0" cellspacing="0" width="100%">
       
    80       <tr valign="top">
       
    81         <td align="left"><span class="table-header">Instance Methods</span></td>
       
    82         <td align="right" valign="top"
       
    83          ><span class="options">[<a href="#section-InstanceMethods"
       
    84          class="privatelink" onclick="toggle_private();"
       
    85          >hide private</a>]</span></td>
       
    86       </tr>
       
    87     </table>
       
    88   </td>
       
    89 </tr>
       
    90 <tr>
       
    91     <td width="15%" align="right" valign="top" class="summary">
       
    92       <span class="summary-type">&nbsp;</span>
       
    93     </td><td class="summary">
       
    94       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
    95         <tr>
       
    96           <td><span class="summary-sig"><a href="configuration.PropertiesConfiguration-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
       
    97         <span class="summary-sig-arg">stream</span>=<span class="summary-sig-default">None</span>,
       
    98         <span class="summary-sig-arg">data</span>=<span class="summary-sig-default">None</span>)</span><br />
       
    99       Initialization.</td>
       
   100           <td align="right" valign="top">
       
   101             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.__init__">source&nbsp;code</a></span>
       
   102             
       
   103           </td>
       
   104         </tr>
       
   105       </table>
       
   106       
       
   107     </td>
       
   108   </tr>
       
   109 <tr class="private">
       
   110     <td width="15%" align="right" valign="top" class="summary">
       
   111       <span class="summary-type">&nbsp;</span>
       
   112     </td><td class="summary">
       
   113       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   114         <tr>
       
   115           <td><span class="summary-sig"><a name="__parse"></a><span class="summary-sig-name">__parse</span>(<span class="summary-sig-arg">self</span>,
       
   116         <span class="summary-sig-arg">lines</span>)</span><br />
       
   117       Parse a list of lines and create
       
   118 an internal property dictionary</td>
       
   119           <td align="right" valign="top">
       
   120             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.__parse">source&nbsp;code</a></span>
       
   121             
       
   122           </td>
       
   123         </tr>
       
   124       </table>
       
   125       
       
   126     </td>
       
   127   </tr>
       
   128 <tr>
       
   129     <td width="15%" align="right" valign="top" class="summary">
       
   130       <span class="summary-type">&nbsp;</span>
       
   131     </td><td class="summary">
       
   132       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   133         <tr>
       
   134           <td><span class="summary-sig"><a name="processPair"></a><span class="summary-sig-name">processPair</span>(<span class="summary-sig-arg">self</span>,
       
   135         <span class="summary-sig-arg">key</span>,
       
   136         <span class="summary-sig-arg">value</span>)</span><br />
       
   137       Process a (key, value) pair</td>
       
   138           <td align="right" valign="top">
       
   139             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.processPair">source&nbsp;code</a></span>
       
   140             
       
   141           </td>
       
   142         </tr>
       
   143       </table>
       
   144       
       
   145     </td>
       
   146   </tr>
       
   147 <tr>
       
   148     <td width="15%" align="right" valign="top" class="summary">
       
   149       <span class="summary-type">&nbsp;</span>
       
   150     </td><td class="summary">
       
   151       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   152         <tr>
       
   153           <td><span class="summary-sig"><a name="escape"></a><span class="summary-sig-name">escape</span>(<span class="summary-sig-arg">self</span>,
       
   154         <span class="summary-sig-arg">value</span>)</span></td>
       
   155           <td align="right" valign="top">
       
   156             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.escape">source&nbsp;code</a></span>
       
   157             
       
   158           </td>
       
   159         </tr>
       
   160       </table>
       
   161       
       
   162     </td>
       
   163   </tr>
       
   164 <tr>
       
   165     <td width="15%" align="right" valign="top" class="summary">
       
   166       <span class="summary-type">&nbsp;</span>
       
   167     </td><td class="summary">
       
   168       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   169         <tr>
       
   170           <td><span class="summary-sig"><a name="unescape"></a><span class="summary-sig-name">unescape</span>(<span class="summary-sig-arg">self</span>,
       
   171         <span class="summary-sig-arg">value</span>)</span></td>
       
   172           <td align="right" valign="top">
       
   173             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.unescape">source&nbsp;code</a></span>
       
   174             
       
   175           </td>
       
   176         </tr>
       
   177       </table>
       
   178       
       
   179     </td>
       
   180   </tr>
       
   181 <tr>
       
   182     <td width="15%" align="right" valign="top" class="summary">
       
   183       <span class="summary-type">&nbsp;</span>
       
   184     </td><td class="summary">
       
   185       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   186         <tr>
       
   187           <td><span class="summary-sig"><a name="load"></a><span class="summary-sig-name">load</span>(<span class="summary-sig-arg">self</span>,
       
   188         <span class="summary-sig-arg">stream</span>)</span><br />
       
   189       Load properties from an open file stream</td>
       
   190           <td align="right" valign="top">
       
   191             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.load">source&nbsp;code</a></span>
       
   192             
       
   193           </td>
       
   194         </tr>
       
   195       </table>
       
   196       
       
   197     </td>
       
   198   </tr>
       
   199 <tr>
       
   200     <td width="15%" align="right" valign="top" class="summary">
       
   201       <span class="summary-type">&nbsp;</span>
       
   202     </td><td class="summary">
       
   203       <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   204         <tr>
       
   205           <td><span class="summary-sig"><a name="store"></a><span class="summary-sig-name">store</span>(<span class="summary-sig-arg">self</span>,
       
   206         <span class="summary-sig-arg">out</span>)</span><br />
       
   207       Serialize the properties back to a file.</td>
       
   208           <td align="right" valign="top">
       
   209             <span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.store">source&nbsp;code</a></span>
       
   210             
       
   211           </td>
       
   212         </tr>
       
   213       </table>
       
   214       
       
   215     </td>
       
   216   </tr>
       
   217   <tr>
       
   218     <td colspan="2" class="summary">
       
   219     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="configuration.Configuration-class.html">Configuration</a></code></b>:
       
   220       <code><a href="configuration.Configuration-class.html#__delitem__">__delitem__</a></code>,
       
   221       <code><a href="configuration.Configuration-class.html#__getitem__">__getitem__</a></code>,
       
   222       <code><a href="configuration.Configuration-class.html#__setitem__">__setitem__</a></code>,
       
   223       <code><a href="configuration.Configuration-class.html#__str__">__str__</a></code>,
       
   224       <code><a href="configuration.Configuration-class.html#get">get</a></code>,
       
   225       <code><a href="configuration.Configuration-class.html#get_boolean">get_boolean</a></code>,
       
   226       <code><a href="configuration.Configuration-class.html#get_int">get_int</a></code>,
       
   227       <code><a href="configuration.Configuration-class.html#get_list">get_list</a></code>,
       
   228       <code><a href="configuration.Configuration-class.html#interpolate">interpolate</a></code>,
       
   229       <code><a href="configuration.Configuration-class.html#keys">keys</a></code>,
       
   230       <code><a href="configuration.Configuration-class.html#match_name">match_name</a></code>
       
   231       </p>
       
   232     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
       
   233       <code>__delattr__</code>,
       
   234       <code>__getattribute__</code>,
       
   235       <code>__hash__</code>,
       
   236       <code>__new__</code>,
       
   237       <code>__reduce__</code>,
       
   238       <code>__reduce_ex__</code>,
       
   239       <code>__repr__</code>,
       
   240       <code>__setattr__</code>
       
   241       </p>
       
   242     <p class="indent-wrapped-lines"><b>Inherited from <code>UserDict.DictMixin</code></b>:
       
   243       <code>__cmp__</code>,
       
   244       <code>__contains__</code>,
       
   245       <code>__iter__</code>,
       
   246       <code>__len__</code>,
       
   247       <code>clear</code>,
       
   248       <code>has_key</code>,
       
   249       <code>items</code>,
       
   250       <code>iteritems</code>,
       
   251       <code>iterkeys</code>,
       
   252       <code>itervalues</code>,
       
   253       <code>pop</code>,
       
   254       <code>popitem</code>,
       
   255       <code>setdefault</code>,
       
   256       <code>update</code>,
       
   257       <code>values</code>
       
   258       </p>
       
   259     </td>
       
   260   </tr>
       
   261 </table>
       
   262 <!-- ==================== CLASS VARIABLES ==================== -->
       
   263 <a name="section-ClassVariables"></a>
       
   264 <table class="summary" border="1" cellpadding="3"
       
   265        cellspacing="0" width="100%" bgcolor="white">
       
   266 <tr bgcolor="#70b0f0" class="table-header">
       
   267   <td colspan="2" class="table-header">
       
   268     <table border="0" cellpadding="0" cellspacing="0" width="100%">
       
   269       <tr valign="top">
       
   270         <td align="left"><span class="table-header">Class Variables</span></td>
       
   271         <td align="right" valign="top"
       
   272          ><span class="options">[<a href="#section-ClassVariables"
       
   273          class="privatelink" onclick="toggle_private();"
       
   274          >hide private</a>]</span></td>
       
   275       </tr>
       
   276     </table>
       
   277   </td>
       
   278 </tr>
       
   279   <tr>
       
   280     <td colspan="2" class="summary">
       
   281     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="configuration.Configuration-class.html">Configuration</a></code></b>:
       
   282       <code><a href="configuration.Configuration-class.html#key_re">key_re</a></code>
       
   283       </p>
       
   284     </td>
       
   285   </tr>
       
   286 </table>
       
   287 <!-- ==================== PROPERTIES ==================== -->
       
   288 <a name="section-Properties"></a>
       
   289 <table class="summary" border="1" cellpadding="3"
       
   290        cellspacing="0" width="100%" bgcolor="white">
       
   291 <tr bgcolor="#70b0f0" class="table-header">
       
   292   <td colspan="2" class="table-header">
       
   293     <table border="0" cellpadding="0" cellspacing="0" width="100%">
       
   294       <tr valign="top">
       
   295         <td align="left"><span class="table-header">Properties</span></td>
       
   296         <td align="right" valign="top"
       
   297          ><span class="options">[<a href="#section-Properties"
       
   298          class="privatelink" onclick="toggle_private();"
       
   299          >hide private</a>]</span></td>
       
   300       </tr>
       
   301     </table>
       
   302   </td>
       
   303 </tr>
       
   304   <tr>
       
   305     <td colspan="2" class="summary">
       
   306     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
       
   307       <code>__class__</code>
       
   308       </p>
       
   309     </td>
       
   310   </tr>
       
   311 </table>
       
   312 <!-- ==================== METHOD DETAILS ==================== -->
       
   313 <a name="section-MethodDetails"></a>
       
   314 <table class="details" border="1" cellpadding="3"
       
   315        cellspacing="0" width="100%" bgcolor="white">
       
   316 <tr bgcolor="#70b0f0" class="table-header">
       
   317   <td colspan="2" class="table-header">
       
   318     <table border="0" cellpadding="0" cellspacing="0" width="100%">
       
   319       <tr valign="top">
       
   320         <td align="left"><span class="table-header">Method Details</span></td>
       
   321         <td align="right" valign="top"
       
   322          ><span class="options">[<a href="#section-MethodDetails"
       
   323          class="privatelink" onclick="toggle_private();"
       
   324          >hide private</a>]</span></td>
       
   325       </tr>
       
   326     </table>
       
   327   </td>
       
   328 </tr>
       
   329 </table>
       
   330 <a name="__init__"></a>
       
   331 <div>
       
   332 <table class="details" border="1" cellpadding="3"
       
   333        cellspacing="0" width="100%" bgcolor="white">
       
   334 <tr><td>
       
   335   <table width="100%" cellpadding="0" cellspacing="0" border="0">
       
   336   <tr valign="top"><td>
       
   337   <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
       
   338         <span class="sig-arg">stream</span>=<span class="sig-default">None</span>,
       
   339         <span class="sig-arg">data</span>=<span class="sig-default">None</span>)</span>
       
   340     <br /><em class="fname">(Constructor)</em>
       
   341   </h3>
       
   342   </td><td align="right" valign="top"
       
   343     ><span class="codelink"><a href="configuration-pysrc.html#PropertiesConfiguration.__init__">source&nbsp;code</a></span>&nbsp;
       
   344     </td>
       
   345   </table>
       
   346   
       
   347   Initialization.
       
   348   <dl class="fields">
       
   349     <dt>Overrides:
       
   350       <a href="configuration.Configuration-class.html#__init__">Configuration.__init__</a>
       
   351         <dd><em class="note">(inherited documentation)</em></dd>
       
   352     </dt>
       
   353   </dl>
       
   354 </td></tr></table>
       
   355 </div>
       
   356 <br />
       
   357 <!-- ==================== NAVIGATION BAR ==================== -->
       
   358 <table class="navbar" border="0" width="100%" cellpadding="0"
       
   359        bgcolor="#a0c0ff" cellspacing="0">
       
   360   <tr valign="middle">
       
   361 
       
   362   <!-- Tree link -->
       
   363       <th>&nbsp;&nbsp;&nbsp;<a
       
   364         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
       
   365 
       
   366   <!-- Index link -->
       
   367       <th>&nbsp;&nbsp;&nbsp;<a
       
   368         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
       
   369 
       
   370   <!-- Help link -->
       
   371       <th>&nbsp;&nbsp;&nbsp;<a
       
   372         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
       
   373 
       
   374       <th class="navbar" width="100%"></th>
       
   375   </tr>
       
   376 </table>
       
   377 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
       
   378   <tr>
       
   379     <td align="left" class="footer">
       
   380     Generated by Epydoc 3.0beta1 on Wed Sep 09 13:44:18 2009
       
   381     </td>
       
   382     <td align="right" class="footer">
       
   383       <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
       
   384     </td>
       
   385   </tr>
       
   386 </table>
       
   387 
       
   388 <script type="text/javascript">
       
   389   <!--
       
   390   // Private objects are initially displayed (because if
       
   391   // javascript is turned off then we want them to be
       
   392   // visible); but by default, we want to hide them.  So hide
       
   393   // them unless we have a cookie that says to show them.
       
   394   checkCookie()
       
   395   // -->
       
   396 </script>
       
   397   
       
   398 </body>
       
   399 </html>