1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
<title>ConfigFileManager.ConfigFileManager Class Reference</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
<link href="tabs.css" rel="stylesheet" type="text/css">
7
<!-- Generated by Doxygen 1.5.4 -->
10
<li><a href="index.html"><span>Main Page</span></a></li>
11
<li><a href="namespaces.html"><span>Packages</span></a></li>
12
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
13
<li><a href="files.html"><span>Files</span></a></li>
18
<li><a href="annotated.html"><span>Class List</span></a></li>
19
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
20
<li><a href="functions.html"><span>Class Members</span></a></li>
24
<a class="el" href="namespaceConfigFileManager.html">ConfigFileManager</a>.<a class="el" href="classConfigFileManager_1_1ConfigFileManager.html">ConfigFileManager</a></div>
25
<h1>ConfigFileManager.ConfigFileManager Class Reference</h1><!-- doxytag: class="ConfigFileManager::ConfigFileManager" -->Manage config parameters and file.
26
<a href="#_details">More...</a>
28
<div class="dynheader">
29
Collaboration diagram for ConfigFileManager.ConfigFileManager:</div>
30
<div class="dynsection">
31
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
34
<a href="classConfigFileManager_1_1ConfigFileManager-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
36
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#9b24b8cd1bf068bab62d7ee24e4927b1">__init__</a></td></tr>
39
<tr><td class="mdescLeft"> </td><td class="mdescRight"><dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
40
<a href="#9b24b8cd1bf068bab62d7ee24e4927b1"></a><br></td></tr>
41
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#4be264488c0890d95968c81d3bb3034c">getWatchedFiles</a></td></tr>
43
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the list of "must be watched" files. <a href="#4be264488c0890d95968c81d3bb3034c"></a><br></td></tr>
44
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#06478b2c41a4e7d551d6ee5fb577f9b3">getReWhiteList</a></td></tr>
46
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the patterns whitelist. <a href="#06478b2c41a4e7d551d6ee5fb577f9b3"></a><br></td></tr>
47
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#827908e333dc2de0b6b667c84639ea56">getReBlackList</a></td></tr>
49
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the patterns blacklist. <a href="#827908e333dc2de0b6b667c84639ea56"></a><br></td></tr>
50
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#cea39bcfd47ea9f379221748686d4bf8">getWhiteList</a></td></tr>
52
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the paths whitelist. <a href="#cea39bcfd47ea9f379221748686d4bf8"></a><br></td></tr>
53
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#a28ec431fac9efcfb5026cf2a8b3a035">getBlackList</a></td></tr>
55
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the Paths blacklist. <a href="#a28ec431fac9efcfb5026cf2a8b3a035"></a><br></td></tr>
56
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#169cf006369c58bb4084f44748b4f9d6">getOptions</a></td></tr>
58
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obtains a list of the options in the section especified. <a href="#169cf006369c58bb4084f44748b4f9d6"></a><br></td></tr>
59
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#340a2733e9166b1cc40f0ace309dce48">getSections</a></td></tr>
61
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obtains a list of the sections in the config file. <a href="#340a2733e9166b1cc40f0ace309dce48"></a><br></td></tr>
62
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#aaccf8816c6ac3f71126c6009a5c0da9">hasOption</a></td></tr>
64
<tr><td class="mdescLeft"> </td><td class="mdescRight">Determines if the section given has te option especified. <a href="#aaccf8816c6ac3f71126c6009a5c0da9"></a><br></td></tr>
65
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#9d0f3defb09f1a4d6647c67ee5c84187">hasSection</a></td></tr>
67
<tr><td class="mdescLeft"> </td><td class="mdescRight">Determines if the section given exists in the config file. <a href="#9d0f3defb09f1a4d6647c67ee5c84187"></a><br></td></tr>
68
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#9b42c97170b94455970d2cfc72d3c8e4">getOptionValue</a></td></tr>
70
<tr><td class="mdescLeft"> </td><td class="mdescRight">: Obtains the value of the given option in the given section. <a href="#9b42c97170b94455970d2cfc72d3c8e4"></a><br></td></tr>
71
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#8b1ac4c5bfc2b4c1639610b43d6f2b1c">getFileOptionValue</a></td></tr>
73
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obtains the value of the given option if exists whithin any section. <a href="#8b1ac4c5bfc2b4c1639610b43d6f2b1c"></a><br></td></tr>
74
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#23aefa6d91d0b35cd1fb6bbc98da6159">addConfigItem</a></td></tr>
76
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add new option to the config file. <a href="#23aefa6d91d0b35cd1fb6bbc98da6159"></a><br></td></tr>
77
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#13998ad15c9af6d30df7a42cef727380">removeConfigItem</a></td></tr>
79
<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a config param from the config file. <a href="#13998ad15c9af6d30df7a42cef727380"></a><br></td></tr>
80
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#84bb0a04a0431ce06c6589686315af9f">removeSection</a></td></tr>
82
<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a section from de config file. <a href="#84bb0a04a0431ce06c6589686315af9f"></a><br></td></tr>
83
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#9e8dc0772f0ba1db88c9821a66880a15">addSection</a></td></tr>
85
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add new section to the config file. <a href="#9e8dc0772f0ba1db88c9821a66880a15"></a><br></td></tr>
86
<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
87
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#c280715d4b706f70602dd08e4287e72b">__mergeFileLists</a></td></tr>
89
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obtains the list of files/dirs to be watched/backuped. <a href="#c280715d4b706f70602dd08e4287e72b"></a><br></td></tr>
90
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#9c1e27d1e65a70c55c98f9905adcddae">__substr</a></td></tr>
92
<tr><td class="mdescLeft"> </td><td class="mdescRight">Determines if wpath is initial substr of bpath. <a href="#9c1e27d1e65a70c55c98f9905adcddae"></a><br></td></tr>
93
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#3f867807472db3c389debe871625552c">__visitor</a></td></tr>
95
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the matches given with the filelist. <a href="#3f867807472db3c389debe871625552c"></a><br></td></tr>
96
<tr><td class="memItemLeft" nowrap align="right" valign="top">def </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#f6aa9771517ce0d2d1c568bc554e1526">__writeConfigObject</a></td></tr>
98
<tr><td class="mdescLeft"> </td><td class="mdescRight">Writes the Config File Object to the File itself. <a href="#f6aa9771517ce0d2d1c568bc554e1526"></a><br></td></tr>
99
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
100
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#13852f78c9e97b013314ec838c532a67">__whitelist</a></td></tr>
102
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#cb62e222fd2a29c111c0d97e4b33fd08">__watchedList</a></td></tr>
104
<tr><td colspan="2"><br><h2>Static Private Attributes</h2></td></tr>
105
<tr><td class="memItemLeft" nowrap align="right" valign="top">list </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#5c2bce7a4b70fae5fcd9451b1f5431ac">__watchedList</a> = []</td></tr>
107
<tr><td class="mdescLeft"> </td><td class="mdescRight">Files to be watched and backuped. <a href="#5c2bce7a4b70fae5fcd9451b1f5431ac"></a><br></td></tr>
108
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#8649567d41fcc1e1c5ce529fe742fbbd">__configFilePath</a> = './prueba.cfg'</td></tr>
110
<tr><td class="mdescLeft"> </td><td class="mdescRight">Path to the config file. <a href="#8649567d41fcc1e1c5ce529fe742fbbd"></a><br></td></tr>
111
<tr><td class="memItemLeft" nowrap align="right" valign="top">tuple </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#0d93e4ee169bcd4986485d360e9fd0fe">__config</a> = ConfigParser.ConfigParser()</td></tr>
113
<tr><td class="mdescLeft"> </td><td class="mdescRight">ConfigParser instance, to manage the file. <a href="#0d93e4ee169bcd4986485d360e9fd0fe"></a><br></td></tr>
114
<tr><td class="memItemLeft" nowrap align="right" valign="top">tuple </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#07804cba380c82e6b894454c9c7b4c4d">__reBlacklist</a> = set()</td></tr>
116
<tr><td class="mdescLeft"> </td><td class="mdescRight">Patterns lists. <a href="#07804cba380c82e6b894454c9c7b4c4d"></a><br></td></tr>
117
<tr><td class="memItemLeft" nowrap align="right" valign="top">tuple </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#19ae6d90288c5906f0a0aa2c4268e309">__reWhitelist</a> = set()</td></tr>
119
<tr><td class="memItemLeft" nowrap align="right" valign="top">tuple </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#7803039fd0898d4fa0381a5459e74242">__blacklist</a> = set()</td></tr>
121
<tr><td class="mdescLeft"> </td><td class="mdescRight">Paths lists. <a href="#7803039fd0898d4fa0381a5459e74242"></a><br></td></tr>
122
<tr><td class="memItemLeft" nowrap align="right" valign="top">tuple </td><td class="memItemRight" valign="bottom"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#a92759fe4d8f57c87383a3c1007ad817">__whitelist</a> = set()</td></tr>
125
<hr><a name="_details"></a><h2>Detailed Description</h2>
126
Manage config parameters and file.
128
Wrapper around ConfigParser to provide <a class="el" href="namespacehdlorean.html">hdlorean</a> a simple interface with the configuration provided by the user and the program defaults. It also makes some operations on the config to make <a class="el" href="namespacehdlorean.html">hdlorean</a> easier manage of the config. <dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
129
<hr><h2>Member Function Documentation</h2>
130
<a class="anchor" name="9b24b8cd1bf068bab62d7ee24e4927b1"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__init__" ref="9b24b8cd1bf068bab62d7ee24e4927b1" args="" -->
131
<div class="memitem">
132
<div class="memproto">
133
<table class="memname">
135
<td class="memname">def ConfigFileManager.ConfigFileManager.__init__ </td>
137
<td class="paramtype"> </td>
138
<td class="paramname"> <em>self</em> </td>
139
<td> ) </td>
140
<td width="100%"></td>
147
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
153
<a class="anchor" name="c280715d4b706f70602dd08e4287e72b"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__mergeFileLists" ref="c280715d4b706f70602dd08e4287e72b" args="" -->
154
<div class="memitem">
155
<div class="memproto">
156
<table class="memname">
158
<td class="memname">def ConfigFileManager.ConfigFileManager.__mergeFileLists </td>
160
<td class="paramtype"> </td>
161
<td class="paramname"> <em>self</em>, </td>
164
<td class="paramkey"></td>
166
<td class="paramtype"> </td>
167
<td class="paramname"> <em>start_dir</em></td><td> </td>
172
<td></td><td></td><td width="100%"><code> [private]</code></td>
179
Obtains the list of files/dirs to be watched/backuped.
181
Unify both whitelist and blacklist (of patterns and of paths) in a new list containing only the files that must be watched/backuped by <a class="el" href="namespacehdlorean.html">hdlorean</a>. The method includes pattern expansion provided by fnmatch. The list is saved into watchedList <dl compact><dt><b>Parameters:</b></dt><dd>
182
<table border="0" cellspacing="2" cellpadding="0">
183
<tr><td valign="top"></td><td valign="top"><em>start_dir</em> </td><td>The root path where the search of patterns will start. </td></tr>
186
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
190
<a class="anchor" name="9c1e27d1e65a70c55c98f9905adcddae"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__substr" ref="9c1e27d1e65a70c55c98f9905adcddae" args="" -->
191
<div class="memitem">
192
<div class="memproto">
193
<table class="memname">
195
<td class="memname">def ConfigFileManager.ConfigFileManager.__substr </td>
197
<td class="paramtype"> </td>
198
<td class="paramname"> <em>self</em>, </td>
201
<td class="paramkey"></td>
203
<td class="paramtype"> </td>
204
<td class="paramname"> <em>bpath</em>, </td>
207
<td class="paramkey"></td>
209
<td class="paramtype"> </td>
210
<td class="paramname"> <em>wpath</em></td><td> </td>
215
<td></td><td></td><td width="100%"><code> [private]</code></td>
222
Determines if wpath is initial substr of bpath.
224
Uses find to determine if the position in bpath of wpath is 0 and then return 1 (true). Otherwise it returns 0 (false). <dl compact><dt><b>Parameters:</b></dt><dd>
225
<table border="0" cellspacing="2" cellpadding="0">
226
<tr><td valign="top"></td><td valign="top"><em>bpath</em> </td><td>String to test if it has wpath as initial substr. </td></tr>
227
<tr><td valign="top"></td><td valign="top"><em>wpath</em> </td><td>String to test if is initial substr of bpath </td></tr>
230
<dl class="return" compact><dt><b>Returns:</b></dt><dd>1 if wpath is substr of bpath. 0 Otherwise. </dd></dl>
231
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
235
<a class="anchor" name="3f867807472db3c389debe871625552c"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__visitor" ref="3f867807472db3c389debe871625552c" args="" -->
236
<div class="memitem">
237
<div class="memproto">
238
<table class="memname">
240
<td class="memname">def ConfigFileManager.ConfigFileManager.__visitor </td>
242
<td class="paramtype"> </td>
243
<td class="paramname"> <em>self</em>, </td>
246
<td class="paramkey"></td>
248
<td class="paramtype"> </td>
249
<td class="paramname"> <em>regexmatrix</em>, </td>
252
<td class="paramkey"></td>
254
<td class="paramtype"> </td>
255
<td class="paramname"> <em>dirname</em>, </td>
258
<td class="paramkey"></td>
260
<td class="paramtype"> </td>
261
<td class="paramname"> <em>filelist</em></td><td> </td>
266
<td></td><td></td><td width="100%"><code> [private]</code></td>
273
Find the matches given with the filelist.
275
Internal function to be used in conjunction with os.path.walk. Each time this function is invoked, finds matches between the regexmatrix patterns and the list of files contained in the filelist arg. Returns each match file in the corresponding list (whitelist or blacklist). <dl compact><dt><b>Parameters:</b></dt><dd>
276
<table border="0" cellspacing="2" cellpadding="0">
277
<tr><td valign="top"></td><td valign="top"><em>regexmatrix</em> </td><td>A matrix containing in the first row the patterns of the blacklist and in the second row the patterns of the whitelist. This argument is provided to os.path.walk by the caller. </td></tr>
278
<tr><td valign="top"></td><td valign="top"><em>dirname</em> </td><td>The current dir. Provided by os.path.walk. </td></tr>
279
<tr><td valign="top"></td><td valign="top"><em>filelist</em> </td><td>All the files contained in dirname. Provided by os.path.walk </td></tr>
282
<dl class="see" compact><dt><b>See also:</b></dt><dd>os.path.walk <p>
284
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián TODO: Don't match regex against dirs?. Avoid repeated patterns between blacklist and whitelist </dd></dl>
288
<a class="anchor" name="f6aa9771517ce0d2d1c568bc554e1526"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__writeConfigObject" ref="f6aa9771517ce0d2d1c568bc554e1526" args="" -->
289
<div class="memitem">
290
<div class="memproto">
291
<table class="memname">
293
<td class="memname">def ConfigFileManager.ConfigFileManager.__writeConfigObject </td>
295
<td class="paramtype"> </td>
296
<td class="paramname"> <em>self</em> </td>
297
<td> ) </td>
298
<td width="100%"><code> [private]</code></td>
305
Writes the Config File Object to the File itself.
307
Write all the changes made in the dynamic config file object to the disk. <dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
311
<a class="anchor" name="4be264488c0890d95968c81d3bb3034c"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getWatchedFiles" ref="4be264488c0890d95968c81d3bb3034c" args="" -->
312
<div class="memitem">
313
<div class="memproto">
314
<table class="memname">
316
<td class="memname">def ConfigFileManager.ConfigFileManager.getWatchedFiles </td>
318
<td class="paramtype"> </td>
319
<td class="paramname"> <em>self</em> </td>
320
<td> ) </td>
321
<td width="100%"></td>
328
Gets the list of "must be watched" files.
330
<dl class="see" compact><dt><b>See also:</b></dt><dd>__mergeFileList </dd></dl>
331
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The list of files that must be watched/backup-ed </dd></dl>
332
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
336
<a class="anchor" name="06478b2c41a4e7d551d6ee5fb577f9b3"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getReWhiteList" ref="06478b2c41a4e7d551d6ee5fb577f9b3" args="" -->
337
<div class="memitem">
338
<div class="memproto">
339
<table class="memname">
341
<td class="memname">def ConfigFileManager.ConfigFileManager.getReWhiteList </td>
343
<td class="paramtype"> </td>
344
<td class="paramname"> <em>self</em> </td>
345
<td> ) </td>
346
<td width="100%"></td>
353
Gets the patterns whitelist.
355
The state of the patterns whitelist changes along the execution of this class, be carefull when you get the list. <dl class="return" compact><dt><b>Returns:</b></dt><dd>A Set containing the whitelisted patterns </dd></dl>
359
<a class="anchor" name="827908e333dc2de0b6b667c84639ea56"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getReBlackList" ref="827908e333dc2de0b6b667c84639ea56" args="" -->
360
<div class="memitem">
361
<div class="memproto">
362
<table class="memname">
364
<td class="memname">def ConfigFileManager.ConfigFileManager.getReBlackList </td>
366
<td class="paramtype"> </td>
367
<td class="paramname"> <em>self</em> </td>
368
<td> ) </td>
369
<td width="100%"></td>
376
Gets the patterns blacklist.
378
The state of the patterns blacklist changes along the execution of this class, be carefull when you get the list. <dl class="return" compact><dt><b>Returns:</b></dt><dd>A Set containing the blacklisted patterns </dd></dl>
382
<a class="anchor" name="cea39bcfd47ea9f379221748686d4bf8"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getWhiteList" ref="cea39bcfd47ea9f379221748686d4bf8" args="" -->
383
<div class="memitem">
384
<div class="memproto">
385
<table class="memname">
387
<td class="memname">def ConfigFileManager.ConfigFileManager.getWhiteList </td>
389
<td class="paramtype"> </td>
390
<td class="paramname"> <em>self</em> </td>
391
<td> ) </td>
392
<td width="100%"></td>
399
Gets the paths whitelist.
401
Keep in mind that the whitelist is not the filtered list of the files that should be watched. It's an aux structure used to obtain the final watchedList. <dl class="see" compact><dt><b>See also:</b></dt><dd>getWatchedList </dd></dl>
402
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A Set containing the paths whitelist. </dd></dl>
406
<a class="anchor" name="a28ec431fac9efcfb5026cf2a8b3a035"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getBlackList" ref="a28ec431fac9efcfb5026cf2a8b3a035" args="" -->
407
<div class="memitem">
408
<div class="memproto">
409
<table class="memname">
411
<td class="memname">def ConfigFileManager.ConfigFileManager.getBlackList </td>
413
<td class="paramtype"> </td>
414
<td class="paramname"> <em>self</em> </td>
415
<td> ) </td>
416
<td width="100%"></td>
423
Gets the Paths blacklist.
425
<dl class="see" compact><dt><b>See also:</b></dt><dd>getReBlacklist </dd></dl>
426
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A Set containing the paths blacklisted </dd></dl>
430
<a class="anchor" name="169cf006369c58bb4084f44748b4f9d6"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getOptions" ref="169cf006369c58bb4084f44748b4f9d6" args="" -->
431
<div class="memitem">
432
<div class="memproto">
433
<table class="memname">
435
<td class="memname">def ConfigFileManager.ConfigFileManager.getOptions </td>
437
<td class="paramtype"> </td>
438
<td class="paramname"> <em>self</em>, </td>
441
<td class="paramkey"></td>
443
<td class="paramtype"> </td>
444
<td class="paramname"> <em>section</em></td><td> </td>
449
<td></td><td></td><td width="100%"></td>
456
Obtains a list of the options in the section especified.
458
Returns in a list the options defined in the section especified. <dl compact><dt><b>Parameters:</b></dt><dd>
459
<table border="0" cellspacing="2" cellpadding="0">
460
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>The section to retrieve the options from </td></tr>
463
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A list filled with the options names contained in the section. </dd></dl>
464
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
468
<a class="anchor" name="340a2733e9166b1cc40f0ace309dce48"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getSections" ref="340a2733e9166b1cc40f0ace309dce48" args="" -->
469
<div class="memitem">
470
<div class="memproto">
471
<table class="memname">
473
<td class="memname">def ConfigFileManager.ConfigFileManager.getSections </td>
475
<td class="paramtype"> </td>
476
<td class="paramname"> <em>self</em> </td>
477
<td> ) </td>
478
<td width="100%"></td>
485
Obtains a list of the sections in the config file.
487
Returns in a list the sections available in the config file. <dl class="return" compact><dt><b>Returns:</b></dt><dd>A list filled with the sections names contained in the file. </dd></dl>
488
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
492
<a class="anchor" name="aaccf8816c6ac3f71126c6009a5c0da9"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::hasOption" ref="aaccf8816c6ac3f71126c6009a5c0da9" args="" -->
493
<div class="memitem">
494
<div class="memproto">
495
<table class="memname">
497
<td class="memname">def ConfigFileManager.ConfigFileManager.hasOption </td>
499
<td class="paramtype"> </td>
500
<td class="paramname"> <em>self</em>, </td>
503
<td class="paramkey"></td>
505
<td class="paramtype"> </td>
506
<td class="paramname"> <em>section</em>, </td>
509
<td class="paramkey"></td>
511
<td class="paramtype"> </td>
512
<td class="paramname"> <em>option</em></td><td> </td>
517
<td></td><td></td><td width="100%"></td>
524
Determines if the section given has te option especified.
526
<a class="el" href="namespaceSearch.html">Search</a> in the given section for the option passed as argument and return a boolean. <dl compact><dt><b>Parameters:</b></dt><dd>
527
<table border="0" cellspacing="2" cellpadding="0">
528
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>The section that may contain de option. </td></tr>
529
<tr><td valign="top"></td><td valign="top"><em>option</em> </td><td>The searched option. </td></tr>
532
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if the option exists whithin the given section and False Otherwise </dd></dl>
533
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
537
<a class="anchor" name="9d0f3defb09f1a4d6647c67ee5c84187"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::hasSection" ref="9d0f3defb09f1a4d6647c67ee5c84187" args="" -->
538
<div class="memitem">
539
<div class="memproto">
540
<table class="memname">
542
<td class="memname">def ConfigFileManager.ConfigFileManager.hasSection </td>
544
<td class="paramtype"> </td>
545
<td class="paramname"> <em>self</em>, </td>
548
<td class="paramkey"></td>
550
<td class="paramtype"> </td>
551
<td class="paramname"> <em>section</em></td><td> </td>
556
<td></td><td></td><td width="100%"></td>
563
Determines if the section given exists in the config file.
565
<a class="el" href="namespaceSearch.html">Search</a> in the config file for the section passed as argument and return a boolean. <dl compact><dt><b>Parameters:</b></dt><dd>
566
<table border="0" cellspacing="2" cellpadding="0">
567
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>The section the caller wants to know if exists. </td></tr>
570
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if the section exists and False Otherwise </dd></dl>
571
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
575
<a class="anchor" name="9b42c97170b94455970d2cfc72d3c8e4"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getOptionValue" ref="9b42c97170b94455970d2cfc72d3c8e4" args="" -->
576
<div class="memitem">
577
<div class="memproto">
578
<table class="memname">
580
<td class="memname">def ConfigFileManager.ConfigFileManager.getOptionValue </td>
582
<td class="paramtype"> </td>
583
<td class="paramname"> <em>self</em>, </td>
586
<td class="paramkey"></td>
588
<td class="paramtype"> </td>
589
<td class="paramname"> <em>section</em>, </td>
592
<td class="paramkey"></td>
594
<td class="paramtype"> </td>
595
<td class="paramname"> <em>option</em>, </td>
598
<td class="paramkey"></td>
600
<td class="paramtype"> </td>
601
<td class="paramname"> <em>type</em> = <code>None</code></td><td> </td>
606
<td></td><td></td><td width="100%"></td>
613
: Obtains the value of the given option in the given section.
615
If the caller needs the option in float, int or bool, it can call the function with that arg in the last place (type). Supported types are float, int and bool. Call the function with just three arguments to get the option without type changes. <dl compact><dt><b>Parameters:</b></dt><dd>
616
<table border="0" cellspacing="2" cellpadding="0">
617
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>Name of the section which contains the option. </td></tr>
618
<tr><td valign="top"></td><td valign="top"><em>option</em> </td><td>Name of the option which value will be returned. </td></tr>
619
<tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>The type of the option. It can be ommited. </td></tr>
622
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The value of the especified option with the type especified. </dd></dl>
623
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
627
<a class="anchor" name="8b1ac4c5bfc2b4c1639610b43d6f2b1c"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::getFileOptionValue" ref="8b1ac4c5bfc2b4c1639610b43d6f2b1c" args="" -->
628
<div class="memitem">
629
<div class="memproto">
630
<table class="memname">
632
<td class="memname">def ConfigFileManager.ConfigFileManager.getFileOptionValue </td>
634
<td class="paramtype"> </td>
635
<td class="paramname"> <em>self</em>, </td>
638
<td class="paramkey"></td>
640
<td class="paramtype"> </td>
641
<td class="paramname"> <em>option</em>, </td>
644
<td class="paramkey"></td>
646
<td class="paramtype"> </td>
647
<td class="paramname"> <em>type</em> = <code>None</code></td><td> </td>
652
<td></td><td></td><td width="100%"></td>
659
Obtains the value of the given option if exists whithin any section.
661
Moves through all the sections in the Config File looking for the given option name. If it exists somewhere, its value is returned. Otherwise a NoOptionError exception is raised. If the name of the section is known, getOptionValue should be used instead of this method, because its much more efficient. <dl compact><dt><b>Parameters:</b></dt><dd>
662
<table border="0" cellspacing="2" cellpadding="0">
663
<tr><td valign="top"></td><td valign="top"><em>option</em> </td><td>Name of the option which value will be returned. </td></tr>
664
<tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>The type of the option. It can be ommited. </td></tr>
667
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The value of the especified option with the type especified. </dd></dl>
668
<dl compact><dt><b>Exceptions:</b></dt><dd>
669
<table border="0" cellspacing="2" cellpadding="0">
670
<tr><td valign="top"></td><td valign="top"><em>NoOptionError</em> </td><td>The searched option doesn't exist. </td></tr>
673
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#9b42c97170b94455970d2cfc72d3c8e4" title=": Obtains the value of the given option in the given section.">getOptionValue</a> </dd></dl>
674
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
678
<a class="anchor" name="23aefa6d91d0b35cd1fb6bbc98da6159"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::addConfigItem" ref="23aefa6d91d0b35cd1fb6bbc98da6159" args="" -->
679
<div class="memitem">
680
<div class="memproto">
681
<table class="memname">
683
<td class="memname">def ConfigFileManager.ConfigFileManager.addConfigItem </td>
685
<td class="paramtype"> </td>
686
<td class="paramname"> <em>self</em>, </td>
689
<td class="paramkey"></td>
691
<td class="paramtype"> </td>
692
<td class="paramname"> <em>section</em>, </td>
695
<td class="paramkey"></td>
697
<td class="paramtype"> </td>
698
<td class="paramname"> <em>option</em>, </td>
701
<td class="paramkey"></td>
703
<td class="paramtype"> </td>
704
<td class="paramname"> <em>value</em></td><td> </td>
709
<td></td><td></td><td width="100%"></td>
716
Add new option to the config file.
718
This method tries to add a new option with its value to the section especified. If the section doesn't exist raise an exception. Otherwise it adds the option to the dynamic estructures and to the config file. <dl compact><dt><b>Parameters:</b></dt><dd>
719
<table border="0" cellspacing="2" cellpadding="0">
720
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>The name of the section in which the option will be added </td></tr>
721
<tr><td valign="top"></td><td valign="top"><em>option</em> </td><td>The name of the option that will be added </td></tr>
722
<tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>The value of the new option added </td></tr>
725
<dl compact><dt><b>Exceptions:</b></dt><dd>
726
<table border="0" cellspacing="2" cellpadding="0">
727
<tr><td valign="top"></td><td valign="top"><em>NoSectionError</em> </td><td>The especified section does not exist </td></tr>
728
<tr><td valign="top"></td><td valign="top"><em>TypeError</em> </td><td>Value must be a string </td></tr>
731
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
735
<a class="anchor" name="13998ad15c9af6d30df7a42cef727380"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::removeConfigItem" ref="13998ad15c9af6d30df7a42cef727380" args="" -->
736
<div class="memitem">
737
<div class="memproto">
738
<table class="memname">
740
<td class="memname">def ConfigFileManager.ConfigFileManager.removeConfigItem </td>
742
<td class="paramtype"> </td>
743
<td class="paramname"> <em>self</em>, </td>
746
<td class="paramkey"></td>
748
<td class="paramtype"> </td>
749
<td class="paramname"> <em>section</em>, </td>
752
<td class="paramkey"></td>
754
<td class="paramtype"> </td>
755
<td class="paramname"> <em>option</em></td><td> </td>
760
<td></td><td></td><td width="100%"></td>
767
Delete a config param from the config file.
769
Remove the option especified from the section given in the config file (dynamic and static). <dl compact><dt><b>Parameters:</b></dt><dd>
770
<table border="0" cellspacing="2" cellpadding="0">
771
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>The section containing the option </td></tr>
772
<tr><td valign="top"></td><td valign="top"><em>option</em> </td><td>The option to be deleted </td></tr>
775
<dl compact><dt><b>Exceptions:</b></dt><dd>
776
<table border="0" cellspacing="2" cellpadding="0">
777
<tr><td valign="top"></td><td valign="top"><em>NoSectionError</em> </td><td>The section especified doesn't exist. </td></tr>
780
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
784
<a class="anchor" name="84bb0a04a0431ce06c6589686315af9f"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::removeSection" ref="84bb0a04a0431ce06c6589686315af9f" args="" -->
785
<div class="memitem">
786
<div class="memproto">
787
<table class="memname">
789
<td class="memname">def ConfigFileManager.ConfigFileManager.removeSection </td>
791
<td class="paramtype"> </td>
792
<td class="paramname"> <em>self</em>, </td>
795
<td class="paramkey"></td>
797
<td class="paramtype"> </td>
798
<td class="paramname"> <em>section</em></td><td> </td>
803
<td></td><td></td><td width="100%"></td>
810
Delete a section from de config file.
812
Remove a section of the config file if it exists. <dl compact><dt><b>Parameters:</b></dt><dd>
813
<table border="0" cellspacing="2" cellpadding="0">
814
<tr><td valign="top"></td><td valign="top"><em>The</em> </td><td>section to remove </td></tr>
817
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if the section really exists and went deleted properly. False otherwise. </dd></dl>
818
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
822
<a class="anchor" name="9e8dc0772f0ba1db88c9821a66880a15"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::addSection" ref="9e8dc0772f0ba1db88c9821a66880a15" args="" -->
823
<div class="memitem">
824
<div class="memproto">
825
<table class="memname">
827
<td class="memname">def ConfigFileManager.ConfigFileManager.addSection </td>
829
<td class="paramtype"> </td>
830
<td class="paramname"> <em>self</em>, </td>
833
<td class="paramkey"></td>
835
<td class="paramtype"> </td>
836
<td class="paramname"> <em>section</em></td><td> </td>
841
<td></td><td></td><td width="100%"></td>
848
Add new section to the config file.
850
This method add a new section to the dynamic structures and writes it to the config file.. <dl compact><dt><b>Parameters:</b></dt><dd>
851
<table border="0" cellspacing="2" cellpadding="0">
852
<tr><td valign="top"></td><td valign="top"><em>section</em> </td><td>The name of the section that will be added </td></tr>
855
<dl compact><dt><b>Exceptions:</b></dt><dd>
856
<table border="0" cellspacing="2" cellpadding="0">
857
<tr><td valign="top"></td><td valign="top"><em>DuplicateSectionError</em> </td><td>The section especified already exists! </td></tr>
860
<dl class="author" compact><dt><b>Author:</b></dt><dd>Adrián </dd></dl>
864
<hr><h2>Member Data Documentation</h2>
865
<a class="anchor" name="5c2bce7a4b70fae5fcd9451b1f5431ac"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__watchedList" ref="5c2bce7a4b70fae5fcd9451b1f5431ac" args="" -->
866
<div class="memitem">
867
<div class="memproto">
868
<table class="memname">
870
<td class="memname">list <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#5c2bce7a4b70fae5fcd9451b1f5431ac">ConfigFileManager.ConfigFileManager.__watchedList</a> = []<code> [static, private]</code> </td>
877
Files to be watched and backuped.
882
<a class="anchor" name="8649567d41fcc1e1c5ce529fe742fbbd"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__configFilePath" ref="8649567d41fcc1e1c5ce529fe742fbbd" args="" -->
883
<div class="memitem">
884
<div class="memproto">
885
<table class="memname">
887
<td class="memname">string <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#8649567d41fcc1e1c5ce529fe742fbbd">ConfigFileManager.ConfigFileManager.__configFilePath</a> = './prueba.cfg'<code> [static, private]</code> </td>
894
Path to the config file.
899
<a class="anchor" name="0d93e4ee169bcd4986485d360e9fd0fe"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__config" ref="0d93e4ee169bcd4986485d360e9fd0fe" args="" -->
900
<div class="memitem">
901
<div class="memproto">
902
<table class="memname">
904
<td class="memname">tuple <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#0d93e4ee169bcd4986485d360e9fd0fe">ConfigFileManager.ConfigFileManager.__config</a> = ConfigParser.ConfigParser()<code> [static, private]</code> </td>
911
ConfigParser instance, to manage the file.
916
<a class="anchor" name="07804cba380c82e6b894454c9c7b4c4d"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__reBlacklist" ref="07804cba380c82e6b894454c9c7b4c4d" args="" -->
917
<div class="memitem">
918
<div class="memproto">
919
<table class="memname">
921
<td class="memname">tuple <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#07804cba380c82e6b894454c9c7b4c4d">ConfigFileManager.ConfigFileManager.__reBlacklist</a> = set()<code> [static, private]</code> </td>
933
<a class="anchor" name="19ae6d90288c5906f0a0aa2c4268e309"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__reWhitelist" ref="19ae6d90288c5906f0a0aa2c4268e309" args="" -->
934
<div class="memitem">
935
<div class="memproto">
936
<table class="memname">
938
<td class="memname">tuple <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#19ae6d90288c5906f0a0aa2c4268e309">ConfigFileManager.ConfigFileManager.__reWhitelist</a> = set()<code> [static, private]</code> </td>
948
<a class="anchor" name="7803039fd0898d4fa0381a5459e74242"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__blacklist" ref="7803039fd0898d4fa0381a5459e74242" args="" -->
949
<div class="memitem">
950
<div class="memproto">
951
<table class="memname">
953
<td class="memname">tuple <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#7803039fd0898d4fa0381a5459e74242">ConfigFileManager.ConfigFileManager.__blacklist</a> = set()<code> [static, private]</code> </td>
965
<a class="anchor" name="a92759fe4d8f57c87383a3c1007ad817"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__whitelist" ref="a92759fe4d8f57c87383a3c1007ad817" args="" -->
966
<div class="memitem">
967
<div class="memproto">
968
<table class="memname">
970
<td class="memname">tuple <a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#a92759fe4d8f57c87383a3c1007ad817">ConfigFileManager.ConfigFileManager.__whitelist</a> = set()<code> [static, private]</code> </td>
980
<a class="anchor" name="13852f78c9e97b013314ec838c532a67"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__whitelist" ref="13852f78c9e97b013314ec838c532a67" args="" -->
981
<div class="memitem">
982
<div class="memproto">
983
<table class="memname">
985
<td class="memname"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#a92759fe4d8f57c87383a3c1007ad817">ConfigFileManager.ConfigFileManager.__whitelist</a><code> [private]</code> </td>
995
<a class="anchor" name="cb62e222fd2a29c111c0d97e4b33fd08"></a><!-- doxytag: member="ConfigFileManager::ConfigFileManager::__watchedList" ref="cb62e222fd2a29c111c0d97e4b33fd08" args="" -->
996
<div class="memitem">
997
<div class="memproto">
998
<table class="memname">
1000
<td class="memname"><a class="el" href="classConfigFileManager_1_1ConfigFileManager.html#5c2bce7a4b70fae5fcd9451b1f5431ac">ConfigFileManager.ConfigFileManager.__watchedList</a><code> [private]</code> </td>
1004
<div class="memdoc">
1010
<hr>The documentation for this class was generated from the following file:<ul>
1011
<li>workspace/unstable/watcher/src/<a class="el" href="ConfigFileManager_8py.html">ConfigFileManager.py</a></ul>
1012
<hr size="1"><address style="text-align: right;"><small>Generated on Sat Dec 15 14:21:09 2007 by
1013
<a href="http://www.doxygen.org/index.html">
1014
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>