<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Tony Kmoch</title>
	<atom:link href="http://tony.czechit.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://tony.czechit.net</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sat, 30 May 2009 20:48:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Skype inspired by me?</title>
		<link>http://tony.czechit.net/2009/05/skype-inspired-by-me/</link>
		<comments>http://tony.czechit.net/2009/05/skype-inspired-by-me/#comments</comments>
		<pubDate>Fri, 29 May 2009 22:16:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=143</guid>
		<description><![CDATA[Sorry, this entry is only available in Czech.
]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://tony.czechit.net/cs/feed/">Czech</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/05/skype-inspired-by-me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Favorite Wordpress plugins</title>
		<link>http://tony.czechit.net/2009/05/favorite-plugins/</link>
		<comments>http://tony.czechit.net/2009/05/favorite-plugins/#comments</comments>
		<pubDate>Wed, 27 May 2009 19:39:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[IT]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=133</guid>
		<description><![CDATA[Sorry, this entry is only available in Czech.
]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://tony.czechit.net/cs/feed/">Czech</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/05/favorite-plugins/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Gentoo web server</title>
		<link>http://tony.czechit.net/2009/05/installing-gentoo-web-server/</link>
		<comments>http://tony.czechit.net/2009/05/installing-gentoo-web-server/#comments</comments>
		<pubDate>Wed, 27 May 2009 19:30:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[IT]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=128</guid>
		<description><![CDATA[Sorry, this entry is only available in Czech.
]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://tony.czechit.net/cs/feed/">Czech</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/05/installing-gentoo-web-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Trac API nezavírá souborovou konexi</title>
		<link>http://tony.czechit.net/2009/04/trac-api-file-handle-leaking/</link>
		<comments>http://tony.czechit.net/2009/04/trac-api-file-handle-leaking/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 16:46:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=127</guid>
		<description><![CDATA[I have written some Python script using Trac API for handling tickets in this bug system. Unfortunately after some time running, it failed with error: IOError: [Errno 24] Too many open files.
I was checking my code and everything was OK. So I downloaded excellent tool called &#8220;Process Explorer&#8220;. In this program, you can watch any [...]]]></description>
			<content:encoded><![CDATA[<p>I have written some Python script using <a href="http://trac.edgewall.org/">Trac</a> API for handling tickets in this bug system. Unfortunately after some time running, it failed with error: <code>IOError: [Errno 24] Too many open files</code>.<br />
I was checking my code and everything was OK. So I downloaded excellent tool called &#8220;<a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx">Process Explorer</a>&#8220;. In this program, you can watch any process.<br />
In menu: View -> Lowe pane view -> Handles you can view all open handles by your program. There I found out, that there is bug in Trac, which is not closing the file handle of log file even when shutdown() function is called.<br />
To fix it, it is necessary next to calling env.shutdown() also call this code:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>env.<span style="color: black;">log</span>, <span style="color: #483d8b;">'_trac_handler'</span><span style="color: black;">&#41;</span>:
  hdlr = env.<span style="color: black;">log</span>._trac_handler
  env.<span style="color: black;">log</span>.<span style="color: black;">removeHandler</span><span style="color: black;">&#40;</span>hdlr<span style="color: black;">&#41;</span>
  hdlr.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/04/trac-api-file-handle-leaking/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zima v Les Menuires, 2009</title>
		<link>http://tony.czechit.net/2009/04/les-menuires/</link>
		<comments>http://tony.czechit.net/2009/04/les-menuires/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 15:35:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[lyžování]]></category>

		<category><![CDATA[výlety]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=120</guid>
		<description><![CDATA[Sorry, this entry is only available in Czech.
]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://tony.czechit.net/cs/feed/">Czech</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/04/les-menuires/feed/</wfw:commentRss>
		</item>
		<item>
		<title>České sociální sítě, pápá</title>
		<link>http://tony.czechit.net/2009/03/ceske-socialni-site-papabyebye-czech-social-networks/</link>
		<comments>http://tony.czechit.net/2009/03/ceske-socialni-site-papabyebye-czech-social-networks/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 19:18:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=117</guid>
		<description><![CDATA[Sorry, this entry is only available in Czech.
]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://tony.czechit.net/cs/feed/">Czech</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/03/ceske-socialni-site-papabyebye-czech-social-networks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Jak proniknout do zabezpečovacího systému Paradox</title>
		<link>http://tony.czechit.net/2009/03/how-to-hack-paradox/</link>
		<comments>http://tony.czechit.net/2009/03/how-to-hack-paradox/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 18:21:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=107</guid>
		<description><![CDATA[Paradox is one of widely used manufacturer of home and company security systems. This company makes several security tools like sirens, IR detectors, etc.  Here in Czech republic is Paradox even certified to secure military areas.
Do you trust this system? You should not. I have found very simple way how to unlock any area remotely, without [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.paradox.ca" target="_blank">Paradox</a> is one of widely used manufacturer of home and company security systems. This company makes several security tools like sirens, IR detectors, etc.  Here in Czech republic is Paradox even <a href="http://www.nbu.cz/en/" target="_blank">certified</a> to secure military areas.</p>
<p>Do you trust this system? You should not. I have found very simple way how to unlock any area remotely, without knowing any password. The security bug is in Paradox&#8217;es IP100 module, which is absolutely unsafe.</p>
<p>IP100 is internet module which allows you to control (check zones status, lock, unlock) your house. <a href="http://www.paradox.com/Products/default.asp?PID=404" target="_blank">Official description</a> of this module about security says:</p>
<ul>
<li>Data sent and received using 128-bit (MD5 and RC4) or 256-bit (AES) data encryption.</li>
<li>Two-way dynamic authentication.</li>
</ul>
<p>This is whopper.  MD5 and RC4 is used only to encrypt the password, not to encrypt the communication. It means that man-in-the middle attacks can be performed, but it it&#8217;s pretty small bug compared to following :-).</p>
<h3>How to make the attack and unlock the property:</h3>
<ol>
<li>Let the user connect into system, or make tiny script which waits for this event. Also social hacking can be used to persuade user to connect. </li>
<li>As soon as any legal user connects to the system, anyone on the same internet subnet as the legal user can perform the attack. This „hacker“ can do any task which IP100 provides (just with entering good URL into browser). He can watch the zones or arm/disarm the object. This „hacker“ doesn&#8217;t need session id (<span style="text-decoration: underline;">because there is no session handling in IP100</span>) nor usercode nor password. Actions described in following points:</li>
<li>To check open zones and locked/unlocked status of all subsystems just point to http://router_ip_address:port/statuslive.html. You will get JavaScript, where you can search for: tbl_useraccess = new Array(9,0,0,0,0,0,0,0); - it&#8217;s array of zones: 9 means unlocked, 5 means „stay“ and so on.  There is also status of all zones.</li>
<li>The real bad thing is, that „hacker“ can unlock the Paradox system just entering this URL: http://router_ip_address:port/statuslive.html?area=00&amp;value=d. Variable „area“ is identifier from array you got from previous step from array tbl_useraccess. To turn Paradox into stay mode, just enter: http://router_ip_address:port/statuslive.html?area=00&amp;value=s.</li>
</ol>
<h3>Conclusion:</h3>
<ul>
<li>The only protection of IP100 module is based on IP address (well it was not intended to use this as security protection, but it was used to avoid parallel usage by several users &#8230; you can get this point from user&#8217;s guide). Don&#8217;t even think about translating IP100 from your internal LAN to internet. Use SSH and portforwarding instead.</li>
<li>Did you ever imagine, that for example webmail would be protected only by IP address, not by user and password. ;o))</li>
</ul>
<h3>What do Paradox think about this?</h3>
<p>I have discussed this bug by phone with Mr. Stephane Racicot (Vice-President Customer Relations of Paradox company). He let engineers from Paradox and local distributor (Mr. Mračna from Eurosat) to check this bug and they drew conclusion not beeing a big bug and maybe they will fix it in some future version.</p>
<p>Make your own decission, whether is it big or small one.  I&#8217;d not like the feeling, that anyone can unlock my house and I&#8217;d strongly recommend potential customers to avoid Paradox company (not because making some mistake, but due their attitude to security and the will to solve problems).</p>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/03/how-to-hack-paradox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Matrix běží na Windowsech</title>
		<link>http://tony.czechit.net/2009/02/matrix-windows/</link>
		<comments>http://tony.czechit.net/2009/02/matrix-windows/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 16:44:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[zábava]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=104</guid>
		<description><![CDATA[

]]></description>
			<content:encoded><![CDATA[<p><object type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1886349&#038;fullscreen=1" width="640" height="360" ><param name="allowfullscreen" value="true"/><param name="wmode" value="transparent"/><param name="AllowScriptAccess" value="true"/><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1886349&#038;fullscreen=1"/><embed src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1886349&#038;fullscreen=1" type="application/x-shockwave-flash" wmode="transparent"  width="640" height="360"  allowScriptAccess="always"></embed></object>
<div style="padding:5px 0; text-align:center; width:640px;"></div>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/02/matrix-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Automatické odesílání bcc kopie u veškeré odchozí pošty z Outlooku 2007</title>
		<link>http://tony.czechit.net/2009/02/bcc-outlook/</link>
		<comments>http://tony.czechit.net/2009/02/bcc-outlook/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 22:24:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=98</guid>
		<description><![CDATA[I have found several commercial plugins for Outlook 2007 allowing sending bcc copy to all outgoing emails. Who would like to spend $30 for this stuff &#8230; in case when in Thunderbird it was pretty common feature.
After couple minutes, I have found free solution using VBA script.
Just put this code into VBAProject.OTM:

Private Sub Application_ItemSend(ByVal Item [...]]]></description>
			<content:encoded><![CDATA[<p>I have found several commercial plugins for Outlook 2007 allowing sending bcc copy to all outgoing emails. Who would like to spend $30 for this stuff &#8230; in case when in Thunderbird it was pretty common feature.</p>
<p>After couple minutes, I have found free solution using VBA script.</p>
<p>Just put this code into VBAProject.OTM:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Private</span> <span style="color: #000080;">Sub</span> Application_ItemSend(<span style="color: #000080;">ByVal</span> Item <span style="color: #000080;">As</span> <span style="color: #000080;">Object</span>, _
                                 Cancel <span style="color: #000080;">As</span> <span style="color: #000080;">Boolean</span>)
    <span style="color: #000080;">Dim</span> objRecip <span style="color: #000080;">As</span> Recipient
    <span style="color: #000080;">Dim</span> strMsg <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
    <span style="color: #000080;">Dim</span> res <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>
    <span style="color: #000080;">Dim</span> strBcc <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
    <span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span>
&nbsp;
    <span style="color: #008000;">' #### USER OPTIONS ####
</span>    <span style="color: #008000;">' address for Bcc -- must be SMTP address or resolvable
</span>    <span style="color: #008000;">' to a name in the address book
</span>    strBcc = &quot;someone@somewhere.dom&quot;
&nbsp;
    <span style="color: #000080;">Set</span> objRecip = Item.Recipients.Add(strBcc)
    objRecip.<span style="color: #000080;">Type</span> = olBCC
    <span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> objRecip.Resolve <span style="color: #000080;">Then</span>
        strMsg = &quot;Could <span style="color: #000080;">not</span> resolve the Bcc recipient. &quot; &amp;amp; _
                 &quot;Do you want still <span style="color: #000080;">to</span> send the message?&quot;
        res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
                &quot;Could <span style="color: #000080;">Not</span> Resolve Bcc Recipient&quot;)
        <span style="color: #000080;">If</span> res = vbNo <span style="color: #000080;">Then</span>
            Cancel = <span style="color: #000080;">True</span>
        <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
    <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
    <span style="color: #000080;">Set</span> objRecip = <span style="color: #000080;">Nothing</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></pre></div></div>

<p>Editor can be opened using Alt+F11 in Outlook 2007, exploring Project tree on the right side and adding Application - ItemSend handler using top comboboxes.</p>
<p>Also it&#8217;s neccessary to change security settings:</p>
<ol>
<li>In Outlook 2000 to 2003, choose <strong>Tools | Macro | Security </strong>and set security to <strong>Medium</strong>. In Outlook 2007, the macro security settings are in the <strong>Tools | Trust Center</strong> dialog. Set macro security to <strong>Warn on all macros</strong>.</li>
<li>Restart Outlook</li>
</ol>
<p>URLs:</p>
<ul>
<li><a href="http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=341">http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=341</a></li>
<li><a href="http://www.outlookcode.com/article.aspx?id=72">http://www.outlookcode.com/article.aspx?id=72</a></li>
<li><a href="http://outlookcode.com/article.aspx?id=49">http://outlookcode.com/article.aspx?id=49</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/02/bcc-outlook/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unicode support for Python&#8217;s logging library</title>
		<link>http://tony.czechit.net/2009/02/unicode-support-for-pythons-logging-library/</link>
		<comments>http://tony.czechit.net/2009/02/unicode-support-for-pythons-logging-library/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 20:59:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://tony.czechit.net/?p=77</guid>
		<description><![CDATA[
class MyFormatter&#40;logging.Formatter&#41;:
  def __init__&#40;self, fmt=None, datefmt=None, encoding='windows-1250'&#41;:
    logging.Formatter.__init__&#40;self, fmt, datefmt&#41;
    self.encoding = encoding
&#160;
  def formatException&#40;self, ei&#41;:
    r = logging.Formatter.formatException&#40;self, ei&#41;
    if type&#40;r&#41; in &#91;types.StringType&#93;:
      r = r.decode&#40;'windows-1250', 'replace'&#41; # Convert to unicode
    return [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> MyFormatter<span style="color: black;">&#40;</span><span style="color: #dc143c;">logging</span>.<span style="color: black;">Formatter</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, fmt=<span style="color: #008000;">None</span>, datefmt=<span style="color: #008000;">None</span>, encoding=<span style="color: #483d8b;">'windows-1250'</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">logging</span>.<span style="color: black;">Formatter</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, fmt, datefmt<span style="color: black;">&#41;</span>
    <span style="color: #008000;">self</span>.<span style="color: black;">encoding</span> = encoding
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> formatException<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, ei<span style="color: black;">&#41;</span>:
    r = <span style="color: #dc143c;">logging</span>.<span style="color: black;">Formatter</span>.<span style="color: black;">formatException</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, ei<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>r<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #dc143c;">types</span>.<span style="color: black;">StringType</span><span style="color: black;">&#93;</span>:
      r = r.<span style="color: black;">decode</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'windows-1250'</span>, <span style="color: #483d8b;">'replace'</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># Convert to unicode</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> r
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> format<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, record<span style="color: black;">&#41;</span>:
    t = <span style="color: #dc143c;">logging</span>.<span style="color: black;">Formatter</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, record<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#91;</span><span style="color: #dc143c;">types</span>.<span style="color: black;">UnicodeType</span><span style="color: black;">&#93;</span>:
      t = t.<span style="color: black;">encode</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">encoding</span>, <span style="color: #483d8b;">'replace'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> t
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> prepareFileAndConsoleLogging<span style="color: black;">&#40;</span>soubor, urovenSoubor=<span style="color: #008000;">None</span>, urovenKonzole=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
  <span style="color: #808080; font-style: italic;"># http://docs.python.org/library/logging.html</span>
  <span style="color: #ff7700;font-weight:bold;">global</span> <span style="color: #dc143c;">logging</span>, libLogger
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">if</span> urovenSoubor == <span style="color: #008000;">None</span>:
    urovenSoubor = <span style="color: #dc143c;">logging</span>.<span style="color: black;">DEBUG</span>
  <span style="color: #ff7700;font-weight:bold;">if</span> urovenKonzole == <span style="color: #008000;">None</span>:
    urovenKonzole = <span style="color: #dc143c;">logging</span>.<span style="color: black;">INFO</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">#logging.basicConfig(level=urovenSoubor)</span>
&nbsp;
  <span style="color: #808080; font-style: italic;"># Soubor</span>
  fileH = <span style="color: #dc143c;">logging</span>.<span style="color: black;">FileHandler</span><span style="color: black;">&#40;</span>soubor, <span style="color: #483d8b;">'a'</span><span style="color: black;">&#41;</span>
  fileH.<span style="color: black;">setLevel</span><span style="color: black;">&#40;</span>urovenSoubor<span style="color: black;">&#41;</span>
  formatterF = MyFormatter<span style="color: black;">&#40;</span>
    fmt=<span style="color: #483d8b;">'%(asctime)s|%(levelname)-8s|%(name)s|%(message)s|%(filename)s|%(funcName)s|%(lineno)d'</span>,
    encoding=<span style="color: #483d8b;">'windows-1250'</span><span style="color: black;">&#41;</span>
  fileH.<span style="color: black;">setFormatter</span><span style="color: black;">&#40;</span>formatterF<span style="color: black;">&#41;</span>
  <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span>.<span style="color: black;">addHandler</span><span style="color: black;">&#40;</span>fileH<span style="color: black;">&#41;</span>
  <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span>.<span style="color: black;">setLevel</span><span style="color: black;">&#40;</span>urovenSoubor<span style="color: black;">&#41;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;"># Konzole</span>
  console = <span style="color: #dc143c;">logging</span>.<span style="color: black;">StreamHandler</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  console.<span style="color: black;">setLevel</span><span style="color: black;">&#40;</span>urovenKonzole<span style="color: black;">&#41;</span>
  <span style="color: #dc143c;">formatter</span> = MyFormatter<span style="color: black;">&#40;</span>
    fmt=<span style="color: #483d8b;">'%(name)s: %(message)s'</span>,
    encoding=<span style="color: #483d8b;">'cp852'</span><span style="color: black;">&#41;</span>
  console.<span style="color: black;">setFormatter</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">formatter</span><span style="color: black;">&#41;</span>
  <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span>.<span style="color: black;">addHandler</span><span style="color: black;">&#40;</span>console<span style="color: black;">&#41;</span>
&nbsp;
  libLogger.<span style="color: black;">info</span><span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'UNICODE: Logování inicializováno (diakritika: ščřžýáíé)'</span><span style="color: black;">&#41;</span>
  libLogger.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'STRING: Logování inicializováno (diakritika: ščřžýáíé)'</span><span style="color: black;">&#41;</span>
  libLogger.<span style="color: black;">debug</span><span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Debug'</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://tony.czechit.net/2009/02/unicode-support-for-pythons-logging-library/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

