<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>wolfg&#039;s Weblog &#187; Python</title>
	<atom:link href="http://guoyong.me/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://guoyong.me</link>
	<description>wolfg&#039;s journey with open source, linux, programming, sysadm ...</description>
	<lastBuildDate>Wed, 04 Apr 2012 12:42:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/cn/</creativeCommons:license>		<item>
		<title>补一张在GoogleDeveloperDay上的合影，顺便预报一下MaemoCJK的新功能</title>
		<link>http://guoyong.me/oss/%e8%a1%a5%e4%b8%80%e5%bc%a0%e5%9c%a8googledeveloperday%e4%b8%8a%e7%9a%84%e5%90%88%e5%bd%b1%ef%bc%8c%e9%a1%ba%e4%be%bf%e9%a2%84%e6%8a%a5%e4%b8%80%e4%b8%8bmaemocjk%e7%9a%84%e6%96%b0%e5%8a%9f%e8%83%bd/</link>
		<comments>http://guoyong.me/oss/%e8%a1%a5%e4%b8%80%e5%bc%a0%e5%9c%a8googledeveloperday%e4%b8%8a%e7%9a%84%e5%90%88%e5%bd%b1%ef%bc%8c%e9%a1%ba%e4%be%bf%e9%a2%84%e6%8a%a5%e4%b8%80%e4%b8%8bmaemocjk%e7%9a%84%e6%96%b0%e5%8a%9f%e8%83%bd/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 06:08:17 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[maemo]]></category>
		<category><![CDATA[maemocjk]]></category>

		<guid isPermaLink="false">http://guoyong.org/2007/06/05/329</guid>
		<description><![CDATA[终于找到这个合影了。 收到Makoto的邮件，MaemoCJK新增了两个功能： 1. IM switch at run time 可以在maemocjk和hildon im之间切换了 2. Uninstall program 不用再一个一个手工删除maemocjk的组件了 最近很忙，争取在两周内完成新功能与scim的整合。]]></description>
			<content:encoded><![CDATA[<p>终于找到这个合影了。<a href='http://guoyong.org/blog/wp-content/uploads/529676818_c218a928ce_o.jpg' title='CPUG.jpg' rel="lightbox[329]"><img src='http://guoyong.org/blog/wp-content/uploads/529676818_c218a928ce_o.thumbnail.jpg' alt='CPUG.jpg' /></a></p>
<p>收到Makoto的邮件，MaemoCJK新增了两个功能：<br />
1. IM switch at run time 可以在maemocjk和hildon im之间切换了<br />
2. Uninstall program 不用再一个一个手工删除maemocjk的组件了</p>
<p>最近很忙，争取在两周内完成新功能与scim的整合。</p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/%e8%a1%a5%e4%b8%80%e5%bc%a0%e5%9c%a8googledeveloperday%e4%b8%8a%e7%9a%84%e5%90%88%e5%bd%b1%ef%bc%8c%e9%a1%ba%e4%be%bf%e9%a2%84%e6%8a%a5%e4%b8%80%e4%b8%8bmaemocjk%e7%9a%84%e6%96%b0%e5%8a%9f%e8%83%bd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Developer Day 2007 in Beijing</title>
		<link>http://guoyong.me/oss/google-developer-day-2007-beijing/</link>
		<comments>http://guoyong.me/oss/google-developer-day-2007-beijing/#comments</comments>
		<pubDate>Thu, 31 May 2007 14:12:33 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[cpug]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[scim]]></category>

		<guid isPermaLink="false">http://guoyong.org/2007/05/31/328</guid>
		<description><![CDATA[挺着牙痛去参加了Google Developer Day，有机会跟CPUG的老朋友见面，结识新朋友，有幸和Python的创始人Guido van Rossum合影，向SuZhe介绍MaemoCJK的情况，值了！更何况收获了一些新的概念和思想，呵呵。 顺便秀几张照片 :) me at entrance me and Guido Linux and Open Source Panel Discussion me and SuZhe Google Developer Day: 北京,中国]]></description>
			<content:encoded><![CDATA[<p>挺着牙痛去参加了Google Developer Day，有机会跟CPUG的老朋友见面，结识新朋友，有幸和Python的创始人Guido van Rossum合影，向SuZhe介绍MaemoCJK的情况，值了！更何况收获了一些新的概念和思想，呵呵。</p>
<p>顺便秀几张照片 :)<br />
<a href='http://guoyong.org/blog/wp-content/uploads/img_1136.JPG' title='me at entrance' rel="lightbox[328]">me at entrance</a><br/><br />
<a href='http://guoyong.org/blog/wp-content/uploads/img_1142.JPG' title='me and Guido' rel="lightbox[328]">me and Guido</a><br/><br />
<a href='http://guoyong.org/blog/wp-content/uploads/img_1147.JPG' title='Linux and Open Source Panel Discussion' rel="lightbox[328]">Linux and Open Source Panel Discussion</a><br/><br />
<a href='http://guoyong.org/blog/wp-content/uploads/img_1152.JPG' title='me and SuZhe' rel="lightbox[328]">me and SuZhe</a></p>
<p><a href="http://picasaweb.google.com/developerday/GoogleDeveloperDay03">Google Developer Day: 北京,中国</a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/google-developer-day-2007-beijing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyGTK里取得一个xpm图标的灰度图</title>
		<link>http://guoyong.me/python/pygtk%e9%87%8c%e5%8f%96%e5%be%97%e4%b8%80%e4%b8%aaxpm%e5%9b%be%e6%a0%87%e7%9a%84%e7%81%b0%e5%ba%a6%e5%9b%be/</link>
		<comments>http://guoyong.me/python/pygtk%e9%87%8c%e5%8f%96%e5%be%97%e4%b8%80%e4%b8%aaxpm%e5%9b%be%e6%a0%87%e7%9a%84%e7%81%b0%e5%ba%a6%e5%9b%be/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 13:47:14 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[pygtk]]></category>

		<guid isPermaLink="false">http://guoyong.org/2007/04/18/313</guid>
		<description><![CDATA[最近用PyMaemo写一个N800上跑的程序时用到的： self.mote_pixbuf = gtk.gdk.pixbuf_new_from_xpm_data(MOTE_PIXMAP) self.mote_gray_pixbuf = self.mote_pixbuf.copy() self.mote_pixbuf.saturate_and_pixelate(self.mote_gray_pixbuf, 0.0, True)]]></description>
			<content:encoded><![CDATA[<p>最近用PyMaemo写一个N800上跑的程序时用到的：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">mote_pixbuf</span><span style="color: Gray;"> = </span><span style="color: Blue;">gtk</span><span style="color: Gray;">.</span><span style="color: Blue;">gdk</span><span style="color: Gray;">.</span><span style="color: Blue;">pixbuf_new_from_xpm_data</span><span style="color: Olive;">(</span><span style="color: Blue;">MOTE_PIXMAP</span><span style="color: Olive;">)</span></li>
<li><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">mote_gray_pixbuf</span><span style="color: Gray;"> = </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">mote_pixbuf</span><span style="color: Gray;">.</span><span style="color: Blue;">copy</span><span style="color: Olive;">()</span></li>
<li><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">mote_pixbuf</span><span style="color: Gray;">.</span><span style="color: Blue;">saturate_and_pixelate</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">mote_gray_pixbuf</span><span style="color: Gray;">, </span><span style="color: Maroon;">0.0</span><span style="color: Gray;">, </span><span style="color: Green;">True</span><span style="color: Olive;">)</span></li></ol></div>
<p><a href='http://guoyong.org/blog/wp-content/uploads/screenshot00.png' title='colored' rel="lightbox[313]"><img src='http://guoyong.org/blog/wp-content/uploads/screenshot00.thumbnail.png' alt='colored' /></a></p>
<p><a href='http://guoyong.org/blog/wp-content/uploads/screenshot01.png' title='grayed' rel="lightbox[313]"><img src='http://guoyong.org/blog/wp-content/uploads/screenshot01.thumbnail.png' alt='grayed' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/pygtk%e9%87%8c%e5%8f%96%e5%be%97%e4%b8%80%e4%b8%aaxpm%e5%9b%be%e6%a0%87%e7%9a%84%e7%81%b0%e5%ba%a6%e5%9b%be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用Google的Co-op服务创建了一个定制搜索引擎 &#8220;Mobile Python&#8221;</title>
		<link>http://guoyong.me/python/%e7%94%a8google%e7%9a%84co-op%e6%9c%8d%e5%8a%a1%e5%88%9b%e5%bb%ba%e4%ba%86%e4%b8%80%e4%b8%aa%e5%ae%9a%e5%88%b6%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e-mobile-python/</link>
		<comments>http://guoyong.me/python/%e7%94%a8google%e7%9a%84co-op%e6%9c%8d%e5%8a%a1%e5%88%9b%e5%bb%ba%e4%ba%86%e4%b8%80%e4%b8%aa%e5%ae%9a%e5%88%b6%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e-mobile-python/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 15:54:21 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/10/30/281</guid>
		<description><![CDATA[今天看了limodou在CU的帖子才知道Google的这个服务 http://google.com/coop/ limodou创建的是python.cn http://google.com/coop/cse?cx=009376466705745340527%3Acpxfleh5jbc 我也创建了一个：Mobile Python，希望搜索Python在移动设备上的开发与应用。 http://google.com/coop/cse?cx=001459140553769941820%3Alsswc4xdqyw]]></description>
			<content:encoded><![CDATA[<p>今天看了limodou在CU的帖子才知道Google的这个服务 http://google.com/coop/</p>
<p>limodou创建的是python.cn</p>
<p>http://google.com/coop/cse?cx=009376466705745340527%3Acpxfleh5jbc</p>
<p>我也创建了一个：Mobile Python，希望搜索Python在移动设备上的开发与应用。</p>
<p>http://google.com/coop/cse?cx=001459140553769941820%3Alsswc4xdqyw</p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/%e7%94%a8google%e7%9a%84co-op%e6%9c%8d%e5%8a%a1%e5%88%9b%e5%bb%ba%e4%ba%86%e4%b8%80%e4%b8%aa%e5%ae%9a%e5%88%b6%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8e-mobile-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>glade+pygtk学习 (3)</title>
		<link>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-3/</link>
		<comments>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-3/#comments</comments>
		<pubDate>Sat, 28 Oct 2006 12:50:13 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/10/28/280</guid>
		<description><![CDATA[这几天用pygtk和glade写了一个不大的应用，在ubuntu下开发，然后移植到Maemo平台。 学习的过程中发现了SimpleGladeApp.py这个module，可以更方便地以面向对象的方式使用libgrade。 还记得serverinfo这个例子吗？里面是这样得到一个widget的实例的： self.wTree = gtk.glade.XML(self.gladefile, self.windowname)&#160; self.logwindowview = self.wTree.get_widget(&#34;textview1&#34;) 用了SimpleGladeApp.py，直接用self.logwindowview就行了。 下面是改造serverinfo使用SimpleGladeApp.py的步骤： 1. 从 http://www.gnomefiles.org/app.php/SimpleGladeApp.py 下载SimpleGladeApp.py 2. 解压缩后把tepache这个脚本放到你的PATH环境变量指定的路径下，比如/usr/local/bin，然后加上执行权限。 3. 我们已经有现成的serverinfo.glade文件了，现在要做的是用tepache这个脚本解析glade文件来生成一个Python模块，里面是一些对应window或dialog等顶层widget的class，并实现他们的callback方法。命令如下（-o选项是为了不覆盖原来的serverinfo.py）： $ tepache serverinfo.glade -o serverinfo_new.pywritten file serverinfo_new.py$ lsserverinfo.glade&#160; &#160;serverinfo_new.py&#160; &#160; &#160; &#160;serverinfo.pyserverinfo.gladep&#160; serverinfo_new.py.orig&#160; SimpleGladeApp.py 可以看到tepache生成了三个文件：serverinfo_new.py, serverinfo_new.py.orig, SimpleGladeApp.py .orig文件很重要，tepache用这个文件保护你在serverinfo_new.py添加的代码，所以不要删除这个文件。 可以先运行serverinfo_new.py看看效果。 4. &#8230; <a href="http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>这几天用pygtk和glade写了一个不大的应用，在ubuntu下开发，然后移植到Maemo平台。</p>
<p>学习的过程中发现了SimpleGladeApp.py这个module，可以更方便地以面向对象的方式使用libgrade。</p>
<p>还记得serverinfo这个例子吗？里面是这样得到一个widget的实例的：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">wTree</span><span style="color: Gray;"> = </span><span style="color: Blue;">gtk</span><span style="color: Gray;">.</span><span style="color: Blue;">glade</span><span style="color: Gray;">.</span><span style="color: Blue;">XML</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">gladefile</span><span style="color: Gray;">, </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">windowname</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; </span></li>
<li><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">logwindowview</span><span style="color: Gray;"> = </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">wTree</span><span style="color: Gray;">.</span><span style="color: Blue;">get_widget</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">textview1</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span></li></ol></div>
<p>用了SimpleGladeApp.py，直接用self.logwindowview就行了。</p>
<p>下面是改造serverinfo使用SimpleGladeApp.py的步骤：</p>
<p>1. 从 http://www.gnomefiles.org/app.php/SimpleGladeApp.py 下载SimpleGladeApp.py</p>
<p>2. 解压缩后把tepache这个脚本放到你的PATH环境变量指定的路径下，比如/usr/local/bin，然后加上执行权限。</p>
<p>3. 我们已经有现成的serverinfo.glade文件了，现在要做的是用tepache这个脚本解析glade文件来生成一个Python模块，里面是一些对应window或dialog等顶层widget的class，并实现他们的callback方法。命令如下（-o选项是为了不覆盖原来的serverinfo.py）：</p>
<div class="hl-surround"><div class="hl-main">$ tepache serverinfo.glade -o serverinfo_new.py<br />written file serverinfo_new.py<br />$ ls<br />serverinfo.glade&nbsp; &nbsp;serverinfo_new.py&nbsp; &nbsp; &nbsp; &nbsp;serverinfo.py<br />serverinfo.gladep&nbsp; serverinfo_new.py.orig&nbsp; SimpleGladeApp.py</div></div>
<p>可以看到tepache生成了三个文件：serverinfo_new.py, serverinfo_new.py.orig, SimpleGladeApp.py<br />
.orig文件很重要，tepache用这个文件保护你在serverinfo_new.py添加的代码，所以不要删除这个文件。</p>
<p>可以先运行serverinfo_new.py看看效果。</p>
<p>4. serverinfo_new.py的部分代码：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Gray;">......</span></li>
<li><span style="color: #ffa500;"># Warning: Do not modify any context comment such as #--</span></li>
<li><span style="color: #ffa500;"># They are required to keep user's code</span></li>
<li><span style="color: Gray;">......</span></li>
<li><span style="color: Green;">from</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">SimpleGladeApp</span><span style="color: Gray;"> </span><span style="color: Green;">import</span><span style="color: Gray;"> </span><span style="color: Blue;">SimpleGladeApp</span></li>
<li><span style="color: Green;">from</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">SimpleGladeApp</span><span style="color: Gray;"> </span><span style="color: Green;">import</span><span style="color: Gray;"> </span><span style="color: Blue;">bindtextdomain</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">app_name</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">serverinfo</span><span style="color: #8b0000;">&quot;</span></li>
<li><span style="color: Blue;">app_version</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">0.0.1</span><span style="color: #8b0000;">&quot;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">glade_dir</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;&quot;</span></li>
<li><span style="color: Blue;">locale_dir</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;&quot;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Blue;">bindtextdomain</span><span style="color: Olive;">(</span><span style="color: Blue;">app_name</span><span style="color: Gray;">, </span><span style="color: Blue;">locale_dir</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Green;">class</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">Serverinfo</span><span style="color: Olive;">(</span><span style="color: Blue;">SimpleGladeApp</span><span style="color: Olive;">)</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">__init__</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">, </span><span style="color: Blue;">path</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">serverinfo.glade</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color: Blue;">root</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">serverinfo</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color: Blue;">domain</span><span style="color: Gray;">=</span><span style="color: Blue;">app_name</span><span style="color: Gray;">, **</span><span style="color: Blue;">kwargs</span><span style="color: Olive;">)</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">path</span><span style="color: Gray;"> = </span><span style="color: Blue;">os</span><span style="color: Gray;">.</span><span style="color: Blue;">path</span><span style="color: Gray;">.</span><span style="color: Blue;">join</span><span style="color: Olive;">(</span><span style="color: Blue;">glade_dir</span><span style="color: Gray;">, </span><span style="color: Blue;">path</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">SimpleGladeApp</span><span style="color: Gray;">.</span><span style="color: Blue;">__init__</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">, </span><span style="color: Blue;">path</span><span style="color: Gray;">, </span><span style="color: Blue;">root</span><span style="color: Gray;">, </span><span style="color: Blue;">domain</span><span style="color: Gray;">, **</span><span style="color: Blue;">kwargs</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#-- Serverinfo.new {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">new</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Olive;">)</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">A new %s has been created</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> % </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">__class__</span><span style="color: Gray;">.</span><span style="color: Blue;">__name__</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#-- Serverinfo.new }</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#-- Serverinfo custom methods {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#&nbsp;&nbsp; Write your own methods here</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#-- Serverinfo custom methods }</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#-- Serverinfo.on_serverinfo_destroy {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">on_serverinfo_destroy</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">, </span><span style="color: Blue;">widget</span><span style="color: Gray;">, *</span><span style="color: Blue;">args</span><span style="color: Olive;">)</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">print</span><span style="color: Gray;">&nbsp;</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">on_serverinfo_destroy called with self.%s</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> % </span><span style="color: Blue;">widget</span><span style="color: Gray;">.</span><span style="color: Blue;">get_name</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: #ffa500;">#-- Serverinfo.on_serverinfo_destroy }</span></li>
<li><span style="color: Gray;">......&nbsp;&nbsp; </span></li>
<li><span style="color: #ffa500;">#-- main {</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Green;">def</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">main</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">serverinfo</span><span style="color: Gray;"> = </span><span style="color: Blue;">Serverinfo</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">demodialog</span><span style="color: Gray;"> = </span><span style="color: Blue;">Demodialog</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">serverinfo</span><span style="color: Gray;">.</span><span style="color: Blue;">run</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">__name__</span><span style="color: Gray;"> == </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">__main__</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">main</span><span style="color: Olive;">()</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: #ffa500;">#-- main }</span></li></ol></div>
<p>5. 现在就可以添加一些代码来实现serverinfo的功能了。注意不要修改形如#&#8211; Demodialog custom methods { 这样的注释，否则如果界面(glade文件)有了改动，tepache就没法做patch了。</p>
<p>把原来的insert_row改成ServerInfo类的一个方法，放在#&#8211; Serverinfo custom methods 注释之间。<br />
goUrl方法也放在这里。 注意访问widget实例的方法已经由</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">host</span><span style="color: Gray;"> = </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">wTree</span><span style="color: Gray;">.</span><span style="color: Blue;">get_widget</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">entry1</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">get_text</span><span style="color: Olive;">()</span></div></div>
<p>变成</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">host</span><span style="color: Gray;"> = </span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">entry1</span><span style="color: Gray;">.</span><span style="color: Blue;">get_text</span><span style="color: Olive;">()</span></div></div>
<p>main方法里的实例化Demodialog的语句要挪到button2的clicked事件响应方法里，不然程序一运行对话框就出现了，你刚才一定注意到了。</p>
<p>destroy响应方法里加入self.gtk_main_quit()以便窗口销毁时能够退出程序。</p>
<p>6. 现在运行serverinfo_new.py，原来serverinfo.py的功能基本上都有了。但有一个问题，对话框弹出后点击“确定”或“取消”按钮都不能关闭对话框。我的解决办法是不在glade设计这个对话框，完成在程序里用代码实现。</p>
<p>7. 注意每次重新设计了界面，修改了glade文件，都要运行tepache来patch生成的python模块，已做的修改不会被覆盖。</p>
<p>新的代码下载地址： http://guoyong.org/?dl=pygtk-learning-serverinfo-simplegladeapp.tar.bz2</p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>glade+pygtk学习 (2)</title>
		<link>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-2/</link>
		<comments>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-2/#comments</comments>
		<pubDate>Wed, 20 Sep 2006 09:42:08 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/09/20/274</guid>
		<description><![CDATA[按照计划，今天参照这篇文章 Building an Application with PyGTK and Glade 学习。第一次使用menu和toolbar，进一步学习了tree/list view的使用，昨天还不太会用的dialog也学会了。 下载源代码： pygtk-learning-pywine.tgz 昨天遗留的几个问题也解决了： 1. 首先完成了那个dialog。虽然没什么功能，就算是复习一下dialog的实现方法吧。 2. 把ServerInfo程序的treeview内容改成显示http的header了。 #get http headers, then insert into tree model data = page.read() headers = page.info() for&#160;name in headers.keys(): &#160; &#160; insert_row(self.treemodel, None, name, headers[name]) &#8230; <a href="http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>按照计划，今天参照这篇文章 <a href="http://www.learningpython.com/2006/05/30/building-an-application-with-pygtk-and-glade/">Building an Application with PyGTK and Glade</a> 学习。第一次使用menu和toolbar，进一步学习了tree/list view的使用，昨天还不太会用的dialog也学会了。</p>
<p>下载源代码： <a href="http://guoyong.org/?dl=pygtk-learning-pywine.tgz">pygtk-learning-pywine.tgz</a></p>
<p>昨天遗留的几个问题也解决了：<br />
1. 首先完成了那个dialog。虽然没什么功能，就算是复习一下dialog的实现方法吧。<br />
2. 把ServerInfo程序的treeview内容改成显示http的header了。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;">#get http headers, then insert into tree model</span></li>
<li><span style="color: Blue;">data</span><span style="color: Gray;"> = </span><span style="color: Blue;">page</span><span style="color: Gray;">.</span><span style="color: Blue;">read</span><span style="color: Olive;">()</span></li>
<li><span style="color: Blue;">headers</span><span style="color: Gray;"> = </span><span style="color: Blue;">page</span><span style="color: Gray;">.</span><span style="color: Blue;">info</span><span style="color: Olive;">()</span></li>
<li><span style="color: Green;">for</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">name</span><span style="color: Gray;"> </span><span style="color: Green;">in</span><span style="color: Gray;"> </span><span style="color: Blue;">headers</span><span style="color: Gray;">.</span><span style="color: Blue;">keys</span><span style="color: Olive;">()</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">insert_row</span><span style="color: Olive;">(</span><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">treemodel</span><span style="color: Gray;">, </span><span style="color: Green;">None</span><span style="color: Gray;">, </span><span style="color: Blue;">name</span><span style="color: Gray;">, </span><span style="color: Blue;">headers</span><span style="color: Olive;">[</span><span style="color: Blue;">name</span><span style="color: Olive;">])</span></li></ol></div>
<p>3. 把页面内容转换成unicode字符。用到了re模块去取页面meta标记里的字符集设置。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">import</span><span style="color: Gray;"> </span><span style="color: Blue;">re</span><span style="color: Gray;">, </span><span style="color: Blue;">string</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span></li>
<li><span style="color: Blue;">r</span><span style="color: Gray;"> = </span><span style="color: Blue;">re</span><span style="color: Gray;">.</span><span style="color: Teal;">compile</span><span style="color: Olive;">(</span><span style="color: Blue;">r</span><span style="color: #8b0000;">&quot;&quot;&quot;</span><span style="color: Red;">.*content=['|&quot;]?text/html;</span><span style="color: Navy;">\s</span><span style="color: Red;">?charset=([a-zA-Z0-9</span><span style="color: Navy;">\-</span><span style="color: Red;">]+)['|&quot;]?.*</span><span style="color: #8b0000;">&quot;&quot;&quot;</span><span style="color: Gray;">, </span><span style="color: Blue;">re</span><span style="color: Gray;">.</span><span style="color: Blue;">S</span><span style="color: Gray;"> | </span><span style="color: Blue;">re</span><span style="color: Gray;">.</span><span style="color: Blue;">I</span><span style="color: Gray;"> | </span><span style="color: Blue;">re</span><span style="color: Gray;">.</span><span style="color: Blue;">M</span><span style="color: Olive;">)</span></li>
<li><span style="color: Blue;">m</span><span style="color: Gray;"> = </span><span style="color: Blue;">r</span><span style="color: Gray;">.</span><span style="color: Blue;">match</span><span style="color: Olive;">(</span><span style="color: Blue;">data</span><span style="color: Olive;">)</span></li>
<li><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">m</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">charset</span><span style="color: Gray;"> = </span><span style="color: Blue;">string</span><span style="color: Gray;">.</span><span style="color: Blue;">lower</span><span style="color: Olive;">(</span><span style="color: Blue;">m</span><span style="color: Gray;">.</span><span style="color: Blue;">group</span><span style="color: Olive;">(</span><span style="color: Maroon;">1</span><span style="color: Olive;">))</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">if</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">charset</span><span style="color: Gray;"> != </span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">data</span><span style="color: Gray;"> = </span><span style="color: Blue;">data</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: Blue;">charset</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">ignore</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">ignore</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;">:</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">data</span><span style="color: Gray;"> = </span><span style="color: Blue;">data</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">ignore</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span></li>
<li><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">logwindow</span><span style="color: Gray;">.</span><span style="color: Blue;">set_text</span><span style="color: Olive;">(</span><span style="color: Blue;">data</span><span style="color: Olive;">)</span></li></ol></div>
<p>4. 用TexBuffer的set_text方法替代了insert_at_cursor。</p>
<p>新ServerInfo程序的源代码： <a href="http://guoyong.org/?dl=pygtk-learning-serverinfo.tgz">pygtk-learning-serverinfo.tgz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>glade+pygtk学习</title>
		<link>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0/</link>
		<comments>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0/#comments</comments>
		<pubDate>Tue, 19 Sep 2006 07:52:18 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/09/19/273</guid>
		<description><![CDATA[今天上午参照 A Beginner&#8217;s Guide to Using pyGTK and Glade 这篇文章学习，感觉确实很好用。文章开始部分对比几种GUI开发库写得挺好，虽然是2003年写的。还有后面提到如何结合socket编程，正好要用到。 照着Demo实做了一遍，发现一些用法已经deprecated了： gtk.TRUE &#8211; 用True就行了 gtk.mainquit &#8211; 换成gtk.main_quit gtk.mainloop() &#8211; 换成gtk.main() 期间犯了个小错误，忘了在glade里为主窗口添加destroy信号，结果没法关闭窗口后没法退出程序。 显示含有中文的页面内容时会在下面这行代码报错，像是编码问题，先不深究了。 self.logwindow.insert_at_cursor(data, len(data)) 自己用为Entry控件加了activate信号，响应回车事件。也准备试试如何显示对话框，还没有完成。 可以在这里下载Demo的源代码： http://guoyong.org/?dl=pygtk-demo.tgz 接下来计划按照这篇文章 [ http://www.learningpython.com/2006/05/30/building-an-application-with-pygtk-and-glade/ ]学习，然后准备自己动手写了。]]></description>
			<content:encoded><![CDATA[<p>今天上午参照 <a href="http://www.linuxjournal.com/article/6586">A Beginner&#8217;s Guide to Using pyGTK and Glade</a> 这篇文章学习，感觉确实很好用。文章开始部分对比几种GUI开发库写得挺好，虽然是2003年写的。还有后面提到如何结合socket编程，正好要用到。</p>
<p>照着Demo实做了一遍，发现一些用法已经deprecated了：</p>
<ul>
<li>gtk.TRUE &#8211;  用True就行了</li>
<li>gtk.mainquit &#8211; 换成gtk.main_quit</li>
<li>gtk.mainloop() &#8211; 换成gtk.main()</li>
</ul>
<p>期间犯了个小错误，忘了在glade里为主窗口添加destroy信号，结果没法关闭窗口后没法退出程序。</p>
<p>显示含有中文的页面内容时会在下面这行代码报错，像是编码问题，先不深究了。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">self</span><span style="color: Gray;">.</span><span style="color: Blue;">logwindow</span><span style="color: Gray;">.</span><span style="color: Blue;">insert_at_cursor</span><span style="color: Olive;">(</span><span style="color: Blue;">data</span><span style="color: Gray;">, </span><span style="color: Teal;">len</span><span style="color: Olive;">(</span><span style="color: Blue;">data</span><span style="color: Olive;">))</span></div></div>
<p>自己用为Entry控件加了activate信号，响应回车事件。也准备试试如何显示对话框，还没有完成。</p>
<p>可以在这里下载Demo的源代码：  http://guoyong.org/?dl=pygtk-demo.tgz</p>
<p>接下来计划按照这篇文章 [ http://www.learningpython.com/2006/05/30/building-an-application-with-pygtk-and-glade/ ]学习，然后准备自己动手写了。</p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/gladepygtk%e5%ad%a6%e4%b9%a0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个把Rss Feed的编码方式由GB2312转成UTF-8的CGI脚本</title>
		<link>http://guoyong.me/cu/%e4%b8%80%e4%b8%aa%e6%8a%8arss-feed%e7%9a%84%e7%bc%96%e7%a0%81%e6%96%b9%e5%bc%8f%e7%94%b1gb2312%e8%bd%ac%e6%88%90utf-8%e7%9a%84cgi%e8%84%9a%e6%9c%ac/</link>
		<comments>http://guoyong.me/cu/%e4%b8%80%e4%b8%aa%e6%8a%8arss-feed%e7%9a%84%e7%bc%96%e7%a0%81%e6%96%b9%e5%bc%8f%e7%94%b1gb2312%e8%bd%ac%e6%88%90utf-8%e7%9a%84cgi%e8%84%9a%e6%9c%ac/#comments</comments>
		<pubDate>Mon, 24 Jul 2006 16:35:55 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[CU]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/07/25/242</guid>
		<description><![CDATA[今天设置自己的Planet站点，用CU的feed做试验，发现会乱码，原因是CU的feed是GB2312编码的。 google到一些资料，但好像并不能完全解决问题： 小林的blog，按照这个方法做没成功。 Web4C，我写完脚本才注意到这个搜索结果，但没找到planet源码里的planetlib.py文件。 我想到的土方法，写一个cgi脚本做proxy，取回feed后做转换编码方式再输出。 转码是这样完成的： str.decode(&#39;GBK&#39;).encode(&#39;UTF-8&#39;) 下载]]></description>
			<content:encoded><![CDATA[<p>今天设置自己的<a title="planet of guoyong.org" href="http://planet.guoyong.org">Planet站点</a>，用CU的feed做试验，发现会乱码，原因是CU的feed是GB2312编码的。</p>
<p>google到一些资料，但好像并不能完全解决问题：</p>
<p><a href="http://blog.myrual.com/2006/07/how-to-process-gb2312-rss-with-planet.html">小林的blog</a>，按照这个方法做没成功。</p>
<p><a href="http://blog.jjgod.org/2005/07/28/planet-uaoo-patch/">Web4C</a>，我写完脚本才注意到这个搜索结果，但没找到planet源码里的planetlib.py文件。</p>
<p>我想到的土方法，写一个cgi脚本做proxy，取回feed后做转换编码方式再输出。</p>
<p>转码是这样完成的： str.decode(&#39;GBK&#39;).encode(&#39;UTF-8&#39;)</p>
<p><a href="/?dl=feed_gb2utf8.cgi">下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/cu/%e4%b8%80%e4%b8%aa%e6%8a%8arss-feed%e7%9a%84%e7%bc%96%e7%a0%81%e6%96%b9%e5%bc%8f%e7%94%b1gb2312%e8%bd%ac%e6%88%90utf-8%e7%9a%84cgi%e8%84%9a%e6%9c%ac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python for S60 1.3.8</title>
		<link>http://guoyong.me/python/python-for-s60-138/</link>
		<comments>http://guoyong.me/python/python-for-s60-138/#comments</comments>
		<pubDate>Tue, 18 Jul 2006 02:25:57 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/07/18/239</guid>
		<description><![CDATA[论坛里有人提醒，Python for S60 1.3.8出来了，这个版本是专门用于S60 3rd Edition的device。下载地址：http://sourceforge.net/projec&#8230;id=171153]]></description>
			<content:encoded><![CDATA[<p><a href="http://guoyong.org/">论坛</a>里有人提醒，<a href="http://opensource.nokia.com/projects/pythonfors60/">Python for S60</a> 1.3.8出来了，这个版本是专门用于S60 3rd Edition的device。下载地址：<a href="http://sourceforge.net/project/showfiles.php?group_id=154155&#038;package_id=171153">http://sourceforge.net/projec&#8230;id=171153</a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/python-for-s60-138/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Scholar Bibtex Parser &#8211; gsbibtex.py</title>
		<link>http://guoyong.me/oss/google-scholar-bibtex-parser-gsbibtexpy/</link>
		<comments>http://guoyong.me/oss/google-scholar-bibtex-parser-gsbibtexpy/#comments</comments>
		<pubDate>Thu, 13 Jul 2006 03:03:09 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/07/13/234</guid>
		<description><![CDATA[与bibtex.py类似，区别： 只针对从Google Scholar中导出的BibTex 不依赖第三方软件(比如bibtex2html) ，完全使用Python。需要pyparsing模块。 效果与bibtex.py类似，但目前不支持style参数 支持对附加文件的链接，包括pdf, ps, dvi, rtf, chm, nh等格式 下载： gsbibtex.py 我只在我使用的desktop edition 1.5.3-1下测试过，OS是Windows XP SP2。 示例： {{{#!gsbibtex@article{iannella2003drm,title={{Digital Rights Management (DRM) Architecture}},author={Iannella, R.},journal={Internet: http://www. dlib. org/dlib/june01/iannella/06iannella. html, Stand},volume={7},year={2003},abstract={this is a abstract},Keywords={drm watermarking},pdf={attachment:demo.pdf},chm={attachment:测试.chm},url={http://www.dlib.org/dlib/june01/iannella/06iannella.html},nh={attachment:数字版权管理（DRM）系统的研究、设计和实现.nh.zip}}@article{俞银燕2005数字版,title={{数字版权保护技术研究综述}},author={俞银燕 and 汤帜},journal={计算机学报},volume={28},number={12},pages={1957-1968},year={2005},publisher={万方数据资源系统},comment={write your comment here}}}}}{{{#!gsbibtex &#8230; <a href="http://guoyong.me/oss/google-scholar-bibtex-parser-gsbibtexpy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>与bibtex.py类似，区别：</p>
<ul>
<li>只针对从Google Scholar中导出的BibTex</li>
<li>不依赖第三方软件(比如bibtex2html) ，完全使用Python。需要<a title="pyparsing" href="http://pyparsing.sourceforge.net/">pyparsing</a>模块。</li>
<li>效果与bibtex.py类似，但目前不支持style参数</li>
<li>支持对附加文件的链接，包括pdf, ps, dvi, rtf, chm, nh等格式</li>
</ul>
<p>下载： <a title="gsbibtex.py" href="/?dl=gsbibtex.py">gsbibtex.py</a></p>
<p>我只在我使用的desktop edition 1.5.3-1下测试过，OS是Windows XP SP2。<br />
示例：</p>
<div class="hl-surround"><div class="hl-main">{{{#!gsbibtex<br />@article{iannella2003drm,<br />title={{Digital Rights Management (DRM) Architecture}},<br />author={Iannella, R.},<br />journal={Internet: http://www. dlib. org/dlib/june01/iannella/06iannella. html, Stand},<br />volume={7},<br />year={2003},<br />abstract={this is a abstract},<br />Keywords={drm watermarking},<br />pdf={attachment:demo.pdf},<br />chm={attachment:测试.chm},<br />url={http://www.dlib.org/dlib/june01/iannella/06iannella.html},<br />nh={attachment:数字版权管理（DRM）系统的研究、设计和实现.nh.zip}<br />}<br />@article{俞银燕2005数字版,<br />title={{数字版权保护技术研究综述}},<br />author={俞银燕 and 汤帜},<br />journal={计算机学报},<br />volume={28},<br />number={12},<br />pages={1957-1968},<br />year={2005},<br />publisher={万方数据资源系统},<br />comment={write your comment here}<br />}<br />}}}<br />{{{#!gsbibtex usekeys=off<br />@article{iannella2003drm,<br />title={{Digital Rights Management (DRM) Architecture}},<br />author={Iannella, R.},<br />journal={Internet: http://www. dlib. org/dlib/june01/iannella/06iannella. html, Stand},<br />volume={7},<br />year={2003}<br />}<br />@article{pitkanen2000tdr,<br />title={{Towards A Digital Rights Management Framework}},<br />author={Pitk{\&quot;a}nen, O. and V{\&quot;a}lim{\&quot;a}ki, M.},<br />journal={IeC2000 Proceedings, UMIST, Manchester, UK},<br />year={2000}<br />}<br />}}}</div></div>
<p>效果：</p>
<p><a title="gsbibtex output" href="http://guoyong.org/blog/wp-content/uploads/gsbibtex.jpg" rel="lightbox[234]"><img alt="gsbibtex output" id="image235" src="http://guoyong.org/blog/wp-content/uploads/gsbibtex.thumbnail.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/google-scholar-bibtex-parser-gsbibtexpy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>我用MoinMoin做PIM</title>
		<link>http://guoyong.me/oss/%e6%88%91%e7%94%a8moinmoin%e5%81%9a%e4%b8%aa%e4%ba%bapim/</link>
		<comments>http://guoyong.me/oss/%e6%88%91%e7%94%a8moinmoin%e5%81%9a%e4%b8%aa%e4%ba%bapim/#comments</comments>
		<pubDate>Fri, 07 Jul 2006 12:07:00 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/07/07/228</guid>
		<description><![CDATA[1. 个人日志 Macro: MonthCalendar, Include 2. 文献管理 Parser: BibTex 3. 记帐 Parser: accountbook Macro: MonthCalendar, AccountBook 这个叫AccountBook的parser和macro是我在老婆的强烈要求下写的。昨天刚刚达到可以使用的阶段。 4. 常用网站链接 Macro: RssReader 5. 管理搜集的电子书 Parser: BibTex &#8230;&#8230; theme用的是sinorca4moin，比较喜欢。 我把用到的MoinMoin扩展都收集到del.icio.us了。http://del.icio.us/wolfg/MoinMoinExtensions]]></description>
			<content:encoded><![CDATA[<p>1. 个人日志 Macro: MonthCalendar, Include<br />
<a target="_blank" title="wikihome" href="http://guoyong.org/blog/wp-content/uploads/wikihome.jpg" rel="lightbox[228]"><img width="128" height="73" border="0" alt="wikihome.jpg" id="image226" src="http://guoyong.org/blog/wp-content/uploads/wikihome.thumbnail.jpg" /></a></p>
<p>2. 文献管理 Parser: BibTex<br />
<a title="bibtex" href="http://guoyong.org/blog/wp-content/uploads/bibtex.jpg" rel="lightbox[228]"><img width="128" height="73" border="0" alt="bibtex.jpg" id="image227" src="http://guoyong.org/blog/wp-content/uploads/bibtex.thumbnail.jpg" /></a></p>
<p>3. 记帐 Parser: accountbook Macro: MonthCalendar, AccountBook</p>
<p>这个叫AccountBook的parser和macro是我在老婆的强烈要求下写的。昨天刚刚达到可以使用的阶段。</p>
<p><a title="accountbook" href="http://guoyong.org/blog/wp-content/uploads/accountbook.jpg" rel="lightbox[228]"><img id="image232" alt="accountbook.jpg" src="http://guoyong.org/blog/wp-content/uploads/accountbook.thumbnail.jpg" /></a></p>
<p>4. 常用网站链接 Macro: RssReader<br />
5. 管理搜集的电子书 Parser: BibTex<br />
&#8230;&#8230;</p>
<p>theme用的是sinorca4moin，比较喜欢。</p>
<p>我把用到的MoinMoin扩展都收集到del.icio.us了。<a target="_blank" href="http://del.icio.us/wolfg/MoinMoinExtensions">http://del.icio.us/wolfg/MoinMoinExtensions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/%e6%88%91%e7%94%a8moinmoin%e5%81%9a%e4%b8%aa%e4%ba%bapim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>在MoinMoin里浏览mind-mapping图</title>
		<link>http://guoyong.me/oss/%e5%9c%a8moinmoin%e9%87%8c%e6%b5%8f%e8%a7%88mindmap%e5%9b%be/</link>
		<comments>http://guoyong.me/oss/%e5%9c%a8moinmoin%e9%87%8c%e6%b5%8f%e8%a7%88mindmap%e5%9b%be/#comments</comments>
		<pubDate>Wed, 05 Jul 2006 06:31:03 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/07/05/224</guid>
		<description><![CDATA[需要安装FreeMindBrowser这个宏。 使用方法： [[FreeMindBrowser( mindmapUrl, width, height )]] 我的MoinMoin的版本是Desktop Edition 1.5.2-1，需要一点点hack，方法见这里。也可以从这里直接下载patch文件。]]></description>
			<content:encoded><![CDATA[<p>需要安装<a target="_blank" href="http://moinmoin.wikiwikiweb.de/MacroMarket/FreeMindBrowser">FreeMindBrowser</a>这个宏。</p>
<p>使用方法：</p>
<div class="hl-surround"><div class="hl-main">[[FreeMindBrowser( mindmapUrl, width, height )]]</div></div>
<p>我的MoinMoin的版本是Desktop Edition 1.5.2-1，需要一点点hack，方法见<a target="_blank" href="http://moinmoin.wikiwikiweb.de/MacroMarket/FreeMindBrowser#head-914d78713efb24ea68c87640ea2643363a1cf00b">这里</a>。也可以从<a target="_blank" href="/programming/">这里</a>直接下载patch文件。</p>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/%e5%9c%a8moinmoin%e9%87%8c%e6%b5%8f%e8%a7%88mindmap%e5%9b%be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用MoinMoin Wiki进行文献管理 － 安装BibTex Parser</title>
		<link>http://guoyong.me/oss/%e4%bd%bf%e7%94%a8moinmoin-wiki%e8%bf%9b%e8%a1%8c%e6%96%87%e7%8c%ae%e7%ae%a1%e7%90%86-%ef%bc%8d-%e5%ae%89%e8%a3%85bibtex-parser/</link>
		<comments>http://guoyong.me/oss/%e4%bd%bf%e7%94%a8moinmoin-wiki%e8%bf%9b%e8%a1%8c%e6%96%87%e7%8c%ae%e7%ae%a1%e7%90%86-%ef%bc%8d-%e5%ae%89%e8%a3%85bibtex-parser/#comments</comments>
		<pubDate>Thu, 29 Jun 2006 14:56:05 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/2006/06/29/220</guid>
		<description><![CDATA[BibTex Parser需要bibtex2html的支持。 先下载bibtex2html。我是在Windows XP上使用MoinMoin Desktop Edition，所以选择Windows版本的bibtex2html，版本为1.79。下载后放到Miktex的bin目录下(我使用CTex，这个目录是C:\CTeX\texmf\miktex\bin)。 bibtex.py需要放到MoinMoin的数据目录中(DATA-DIR/plugin/parser)，DATA-DIR是在wikiconfig.py 中指定的那个目录。 需要修改bibtex.py，第177和178行，指定bibtex2html.exe和bibtex.exe的位置。由于这两个程序都在C:\CTeX\texmf\miktex\bin目录下，已经包含在PATH环境变量里了，所以这里改成下面这样就可以： bibtex2html = 'bibtex2html.exe'bibtex = 'bibtex.exe' 但不知为什么 bibtex2html.exe 的stdin和stdout在Windows下无法工作，解析不了BibTex标记，所以我改成使用临时文件的方式。改动后的bibtex.py可以在这里下载(也可以用这个patch文件)。 现在，可以从Google Scholar导出BibTex放进Wiki页面了。 { { {#!bibtex@Book{aho.74,author= {Alfred V. Aho and John E. Hopcroft and Jeffrey D. Ullman},title = {The Design and Analysis of Computer &#8230; <a href="http://guoyong.me/oss/%e4%bd%bf%e7%94%a8moinmoin-wiki%e8%bf%9b%e8%a1%8c%e6%96%87%e7%8c%ae%e7%ae%a1%e7%90%86-%ef%bc%8d-%e5%ae%89%e8%a3%85bibtex-parser/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="bibtex" target="_blank" href="http://moinmoin.wikiwikiweb.de/ParserMarket/bibtex">BibTex Parser</a>需要<a title="bibtex2html" target="_blank" href="http://www.lri.fr/~filliatr/bibtex2html/">bibtex2html</a>的支持。</p>
<p>先下载bibtex2html。我是在Windows XP上使用MoinMoin Desktop Edition，所以选择Windows版本的bibtex2html，版本为1.79。下载后放到Miktex的bin目录下(我使用CTex，这个目录是C:\CTeX\texmf\miktex\bin)。</p>
<p>bibtex.py需要放到MoinMoin的数据目录中(DATA-DIR/plugin/parser)，DATA-DIR是在wikiconfig.py 中指定的那个目录。</p>
<p>需要修改bibtex.py，第177和178行，指定bibtex2html.exe和bibtex.exe的位置。由于这两个程序都在C:\CTeX\texmf\miktex\bin目录下，已经包含在PATH环境变量里了，所以这里改成下面这样就可以：</p>
<div class="hl-surround"><div class="hl-main">bibtex2html = 'bibtex2html.exe'<br />bibtex = 'bibtex.exe'</div></div>
<p>但不知为什么 bibtex2html.exe  的stdin和stdout在Windows下无法工作，解析不了BibTex标记，所以我改成使用临时文件的方式。改动后的bibtex.py可以在这里<a title="bibtex.py" href="/?dl=bibtex.py">下载</a>(也可以用这个<a title="bibtex.py.patch" href="/?dl=bibtex.py.patch">patch文件</a>)。</p>
<p>现在，可以从Google Scholar导出BibTex放进Wiki页面了。</p>
<div class="hl-surround"><div class="hl-main">{ { {#!bibtex<br />@Book{aho.74,<br />author= {Alfred V. Aho and John E. Hopcroft and Jeffrey D. Ullman},<br />title = {The Design and Analysis of Computer Algorithms},<br />publisher= {Addison-Wesley},<br />year&nbsp; = {1974},<br />}<br />} } }</div></div>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/%e4%bd%bf%e7%94%a8moinmoin-wiki%e8%bf%9b%e8%a1%8c%e6%96%87%e7%8c%ae%e7%ae%a1%e7%90%86-%ef%bc%8d-%e5%ae%89%e8%a3%85bibtex-parser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PyS60中使用中文</title>
		<link>http://guoyong.me/python/pys60%e4%b8%ad%e4%bd%bf%e7%94%a8%e4%b8%ad%e6%96%87/</link>
		<comments>http://guoyong.me/python/pys60%e4%b8%ad%e4%bd%bf%e7%94%a8%e4%b8%ad%e6%96%87/#comments</comments>
		<pubDate>Mon, 24 Apr 2006 15:00:16 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/blog/2006/04/24/153</guid>
		<description><![CDATA[# -*- coding: utf-8 -*- import&#160;appuifw appuifw.note(&#34;你好&#34;.decode(&#34;utf8&#34;), &#34;info&#34;)]]></description>
			<content:encoded><![CDATA[<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;"># -*- coding: utf-8 -*-</span></li>
<li><span style="color: Green;">import</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">appuifw</span></li>
<li><span style="color: Blue;">appuifw</span><span style="color: Gray;">.</span><span style="color: Blue;">note</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">你好</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">.</span><span style="color: Blue;">decode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">utf8</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">, </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">info</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span></li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/python/pys60%e4%b8%ad%e4%bd%bf%e7%94%a8%e4%b8%ad%e6%96%87/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>安装MoinMoin Wiki后的简单配置</title>
		<link>http://guoyong.me/oss/%e5%ae%89%e8%a3%85moinmoin-wiki%e5%90%8e%e7%9a%84%e7%ae%80%e5%8d%95%e9%85%8d%e7%bd%ae/</link>
		<comments>http://guoyong.me/oss/%e5%ae%89%e8%a3%85moinmoin-wiki%e5%90%8e%e7%9a%84%e7%ae%80%e5%8d%95%e9%85%8d%e7%bd%ae/#comments</comments>
		<pubDate>Tue, 28 Mar 2006 07:22:12 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guoyong.org/blog/2006/03/28/162</guid>
		<description><![CDATA[访问已运行的Wiki，http://localhost/mywiki 注册一个新的用户，比如admin。 wikiconfig.py的修改如下： 1. 设置默认的访问权限： superuser = [u&#34;admin&#34;, ] 这句设定刚建的admin用户为superuser acl_rights_default = &#39;All:&#39; acl_rights_before = u&#39;admin:read,write,delete,revert,admin Known:read,write&#39; 这里，我设置的权限是：默认没有任何权限，必须登录才能使用Wiki；admin用户具有管理员的权限；其他用户登录后可以读写Wiki。(好像和Wiki的精神不符啊。 文档里有几种典型的权限配置供参考) 重启Apache，让配置生效。 2. 配置MoinMoin使用中文 用admin用户登录，按照Wiki的提示，访问SystemPagesSetup页，安装所需的简体中文包。 navi_bar = [ # If you want to show your page_front_page here: u&#39;%(page_front_page)s&#39;, u&#39;RecentChanges&#39;, u&#39;FindPage&#39;, u&#39;HelpContents&#39;, ] &#8230; <a href="http://guoyong.me/oss/%e5%ae%89%e8%a3%85moinmoin-wiki%e5%90%8e%e7%9a%84%e7%ae%80%e5%8d%95%e9%85%8d%e7%bd%ae/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>访问已运行的Wiki，http://localhost/mywiki<br />
注册一个新的用户，比如admin。</p>
<p>wikiconfig.py的修改如下：</p>
<p><strong>1. 设置默认的访问权限：</strong></p>
<p>superuser = [u&quot;admin&quot;, ]<br />
这句设定刚建的admin用户为superuser<br />
acl_rights_default = &#39;All:&#39;<br />
acl_rights_before = u&#39;admin:read,write,delete,revert,admin Known:read,write&#39;<br />
这里，我设置的权限是：默认没有任何权限，必须登录才能使用Wiki；admin用户具有管理员的权限；其他用户登录后可以读写Wiki。(好像和Wiki的精神不符啊。 文档里有<a href="http://moinmoin.wikiwikiweb.de/HelpOnAccessControlLists#head-7a54879603c7bffec991b53c9381a45f658b2267">几种典型的权限配置</a>供参考)<br />
重启Apache，让配置生效。</p>
<p><strong>2. 配置MoinMoin使用中文</strong></p>
<p>用admin用户登录，按照Wiki的提示，访问SystemPagesSetup页，安装所需的简体中文包。</p>
<p>navi_bar = [<br />
# If you want to show your page_front_page here:<br />
u&#39;%(page_front_page)s&#39;,<br />
u&#39;RecentChanges&#39;,<br />
u&#39;FindPage&#39;,<br />
u&#39;HelpContents&#39;,<br />
]<br />
在导航里显示FrontPage链接</p>
<p>设置默认语言为中文<br />
language_default = &#39;zh&#39;</p>
<p>page_category_regex = u&#39;^Category[A-Z]|类$&#39;<br />
page_dict_regex = u&#39;[a-z]Dict$|字典$&#39;<br />
page_form_regex = u&#39;[a-z]Form$|表$&#39;<br />
page_group_regex = u&#39;[a-z]Group$|组$&#39;<br />
page_template_regex = u&#39;[a-z]Template$|模板$&#39;</p>
<p>保存wikiconfig.py后记得重启Apache。</p>
<p><strong>参考</strong>：</p>
<ul>
<li><a href="http://moinmoin.wikiwikiweb.de/HelpOnConfiguration">/HelpOnConfiguration</a></li>
<li><a href="http://moinmoin.wikiwikiweb.de/HelpOnAccessControlLists">/HelpOnAccessControlLists</a></li>
<li><a href="http://moinmoin.wikiwikiweb.de/HelpOnLanguages">/HelpOnLanguages</a></li>
<li><a href="http://moinmoin.wikiwikiweb.de/ConfigMarket">/ConfigMarket</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.me/oss/%e5%ae%89%e8%a3%85moinmoin-wiki%e5%90%8e%e7%9a%84%e7%ae%80%e5%8d%95%e9%85%8d%e7%bd%ae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.683 seconds -->

