3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 19:49:24 +01:00
PyLink/docs/technical/autogen/conf.html
2016-03-26 11:42:12 -07:00

54 lines
3.8 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module conf</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>conf</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/gl/pylink/conf.py">/home/gl/pylink/conf.py</a></font></td></tr></table>
<p><tt>conf.py&nbsp;-&nbsp;PyLink&nbsp;configuration&nbsp;core.<br>
&nbsp;<br>
This&nbsp;module&nbsp;is&nbsp;used&nbsp;to&nbsp;access&nbsp;the&nbsp;complete&nbsp;configuration&nbsp;for&nbsp;the&nbsp;current<br>
PyLink&nbsp;instance.&nbsp;It&nbsp;will&nbsp;load&nbsp;the&nbsp;config&nbsp;on&nbsp;first&nbsp;import,&nbsp;taking&nbsp;the<br>
configuration&nbsp;file&nbsp;name&nbsp;from&nbsp;the&nbsp;first&nbsp;command-line&nbsp;argument,&nbsp;but&nbsp;defaulting<br>
to&nbsp;'config.yml'&nbsp;if&nbsp;this&nbsp;isn't&nbsp;given.<br>
&nbsp;<br>
If&nbsp;world.testing&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;it&nbsp;will&nbsp;return&nbsp;a&nbsp;preset&nbsp;testing&nbsp;configuration<br>
instead.<br>
&nbsp;<br>
This&nbsp;module&nbsp;also&nbsp;provides&nbsp;simple&nbsp;checks&nbsp;for&nbsp;validating&nbsp;and&nbsp;loading&nbsp;YAML-format<br>
configurations&nbsp;from&nbsp;arbitrary&nbsp;files.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="world.html">world</a><br>
</td><td width="25%" valign=top><a href="yaml.html">yaml</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-loadConf"><strong>loadConf</strong></a>(fname, errors_fatal=True)</dt><dd><tt>Loads&nbsp;a&nbsp;PyLink&nbsp;configuration&nbsp;file&nbsp;from&nbsp;the&nbsp;filename&nbsp;given.</tt></dd></dl>
<dl><dt><a name="-validateConf"><strong>validateConf</strong></a>(conf)</dt><dd><tt>Validates&nbsp;a&nbsp;parsed&nbsp;configuration&nbsp;dict.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>conf</strong> = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(&lt;function &lt;lambda&gt; at 0x7fbb4a5c3840&gt;, {})}<br>
<strong>confname</strong> = 'testconf'<br>
<strong>fname</strong> = None<br>
<strong>testconf</strong> = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(&lt;function &lt;lambda&gt; at 0x7fbb4a5c3840&gt;, {})}</td></tr></table>
</body></html>