<?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/"
	>

<channel>
	<title>Mostly Pythonic</title>
	<atom:link href="http://blogs.gnome.org/gianmt/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/gianmt</link>
	<description>Just another GNOME Blogs weblog</description>
	<lastBuildDate>Sat, 31 Jan 2009 16:16:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compiling PyGobject on windows</title>
		<link>http://blogs.gnome.org/gianmt/2009/01/05/compiling-pygobject-on-windows/</link>
		<comments>http://blogs.gnome.org/gianmt/2009/01/05/compiling-pygobject-on-windows/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 19:16:39 +0000</pubDate>
		<dc:creator>gianmt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[pygobject]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/gianmt/?p=7</guid>
		<description><![CDATA[It has been a nightmare from the beginning&#8230;.
Starting from the new release of Gobject bindings a lot has changed, we now have a new namespace glib where a lot of classes have been moved, of course retaining backward compatibility.
The new library (libpyglib) needs to be shared and not static, so I changed a couple of [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a nightmare from the beginning&#8230;.</p>
<p>Starting from the new release of Gobject bindings a lot has changed, we now have a new namespace <strong>glib </strong>where a lot of classes have been moved, of course retaining backward compatibility.</p>
<p>The new library (libpyglib) needs to be shared and not static, so I changed a couple of lines in Makefile.am to build it as a shared lib, basically adding -no-undefined in <strong>libpyglib_2_0_la_LDFLAGS</strong>, so far so good, the linker is much more happy.</p>
<p>The second problem came when python libs where not linked against this new library, after some resarch I came across a modification to the macro <strong>AM_CHECK_PYTHON_HEADERS </strong>into gnome-python-extras that Armin Burgmeier made, taking it from a modified version from Murray Cumming&#8230; it looks like we do a lot of copy/paste on this things.</p>
<p>So now I have got my <strong>$(PYTHON_LDFLAGS)</strong> to add to <strong>libpyglib_2_0_la_LIBADD </strong>and also to the other modules glib gio and gobject, so far so good.</p>
<p>Now i can get it to compile, the dll&#8217;s are created and I can change them to .pyd extension which python expects to have, so far so good.</p>
<p>Now when I try to import one of those modules from python I get:</p>
<pre>&gt;&gt;&gt; import glib
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/opt/python25/Lib/site-packages/gtk-2.0/glib\__init__.py", line 30, in &lt;module&gt;
    from glib._glib import *
ImportError: DLL load failed: The specified module could not be found.
&gt;&gt;&gt;</pre>
<p>Now I see two different problems here, obviously the first one is that libpyglib-2.0.dll  not found but it&#8217;s in the right place <strong>C:\opt\Python25\DLLs</strong>, the second problem is that there is a path hardcoded (/opt/python25/Lib/site-packages/gtk-2.0/glib\__init__.py) and I don&#8217;t understand why is that.</p>
<p>My .profile looks like this:</p>
<pre>export PATH=/opt/gnome2/bin:/opt/svn/bin:/opt/python25:$PATH
export LD_LIBRARY_PATH=/opt/gnome2/lib
export PKG_CONFIG_PATH=/opt/gnome2/lib/pkgconfig:/c/opt/python25/lib/pkgconfig
export ACLOCAL_FLAGS="-I /opt/gnome2/share/aclocal"
export CC='gcc -mms-bitfields -mthreads'
export CPPFLAGS='-I/opt/gnome2/include -I/opt/gnuwin32/include -I/opt/python25/include'
export CFLAGS=-g
export LDFLAGS='-L/opt/gnome2/lib -L/opt/gnuwin32/lib'
export am_cv_python_pythondir=/opt/python25/Lib/site-packages
export am_cv_python_pyexecdir=/opt/python25/Lib/site-packages</pre>
<p>I run autogen like this:</p>
<pre>$ ./autogen.sh --prefix=/opt/Python25 --disable-docs</pre>
<p>If someone has got ideas please help <img src='http://blogs.gnome.org/gianmt/wp-content/mu-plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/gianmt/2009/01/05/compiling-pygobject-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pygtksourceview2 updated</title>
		<link>http://blogs.gnome.org/gianmt/2008/01/06/pygtksourceview2-updated/</link>
		<comments>http://blogs.gnome.org/gianmt/2008/01/06/pygtksourceview2-updated/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 19:30:51 +0000</pubDate>
		<dc:creator>gianmt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/gianmt/2008/01/06/pygtksourceview2-updated/</guid>
		<description><![CDATA[Pygtksourceview2 is now updated with the latest goodies of gtksourceview.
I&#8217;ve also written the docs that were missing in previous releases, for now you can find them here 
Have fun!
]]></description>
			<content:encoded><![CDATA[<p>Pygtksourceview2 is now updated with the latest <a href="http://blogs.gnome.org/johannes/2008/01/05/gtksourceview-21-in-anjuta/">goodies</a> of gtksourceview.</p>
<p>I&#8217;ve also written the docs that were missing in previous releases, for now you can find them <a href="http://www.gnome.org/~gianmt/pygtksourceview2/">here </a></p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/gianmt/2008/01/06/pygtksourceview2-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PyGTK 2.12.0 is out!</title>
		<link>http://blogs.gnome.org/gianmt/2007/09/25/pygtk-2120-is-out/</link>
		<comments>http://blogs.gnome.org/gianmt/2007/09/25/pygtk-2120-is-out/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 20:23:12 +0000</pubDate>
		<dc:creator>gianmt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/gianmt/2007/09/25/pygtk-2120-is-out/</guid>
		<description><![CDATA[After a couple of months of hard work PyGTK 2.12.0 is finally in the wild! You can read the  announcement
A lot of work is still to be done, especially on docs, cannot wait to help&#8230;?? drop us an email!
]]></description>
			<content:encoded><![CDATA[<p>After a couple of months of hard work PyGTK 2.12.0 is finally in the wild! You can read the  <a href="http://mail.gnome.org/archives/gtk-devel-list/2007-September/msg00118.html">announcement</a></p>
<p>A lot of work is still to be done, especially on docs, cannot wait to help&#8230;?? drop us an email!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/gianmt/2007/09/25/pygtk-2120-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I finally managed to wrap glib.Regex()</title>
		<link>http://blogs.gnome.org/gianmt/2007/07/05/i-finally-managed-to-wrap-glibregex/</link>
		<comments>http://blogs.gnome.org/gianmt/2007/07/05/i-finally-managed-to-wrap-glibregex/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 22:00:32 +0000</pubDate>
		<dc:creator>gianmt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/gianmt/2007/07/05/i-finally-managed-to-wrap-glibregex/</guid>
		<description><![CDATA[After a couple of weeks of fighting with GRegex I finally finished the bindings.
Despite the fact that in the python standard library we already have a regular expression module, glib.Regex()  is a more powerful way to manage regexp, a simple example is something like:
import glib
def print_uppercase_words(str):
regex = glib.Regex(&#8221;[A-Z]+&#8221;, 0, 0)
match_info = regex.match_full(str, -1, 0, [...]]]></description>
			<content:encoded><![CDATA[<p>After a couple of weeks of fighting with GRegex I finally finished the bindings.</p>
<p>Despite the fact that in the python standard library we already have a regular expression module, glib.Regex()  is a more powerful way to manage regexp, a simple example is something like:</p>
<p>import glib</p>
<p>def print_uppercase_words(str):<br />
regex = glib.Regex(&#8221;[A-Z]+&#8221;, 0, 0)<br />
match_info = regex.match_full(str, -1, 0, 0)</p>
<p>while match_info.matches():<br />
word = match_info.fetch(0)<br />
print word<br />
match_info.next()</p>
<p>reg = match_info.get_regex()<br />
print reg.get_pattern()</p>
<p>print_uppercase_words(&#8221;SOLO upPerCase LettErs&#8221;)</p>
<p>which will produce this output:</p>
<p>gianmt@urano:~$ python regex.py<br />
SOLO<br />
P<br />
C<br />
L<br />
E<br />
[A-Z]+</p>
<p>Luckyly is what I expected to see&#8230;. <img src='http://blogs.gnome.org/gianmt/wp-content/mu-plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
<p>Of course I need to test it and especially&#8230;.write the docs!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/gianmt/2007/07/05/i-finally-managed-to-wrap-glibregex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I owe a beer to Tim Janik</title>
		<link>http://blogs.gnome.org/gianmt/2007/06/16/i-owe-a-beer-to-tim-janik/</link>
		<comments>http://blogs.gnome.org/gianmt/2007/06/16/i-owe-a-beer-to-tim-janik/#comments</comments>
		<pubDate>Sat, 16 Jun 2007 12:20:26 +0000</pubDate>
		<dc:creator>gianmt</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/gianmt/2007/06/16/i-owe-a-beer-to-tim-janik/</guid>
		<description><![CDATA[So here is my first post in this brand new blog.
The title is not quite self-explaining but I&#8217;ve never been good at titles.
I&#8217;m trying to wrap as much as possible of Glib to python, that means, at the moment, avoid duplicating what is already in pygobject and what is in the python standard library, anyway [...]]]></description>
			<content:encoded><![CDATA[<p>So here is my first post in this brand new blog.</p>
<p>The title is not quite self-explaining but I&#8217;ve never been good at titles.</p>
<p>I&#8217;m trying to wrap as much as possible of <a href="http://developer.gnome.org/doc/API/2.0/glib/index.html" title="GLIB">Glib</a> to python, that means, at the moment, avoid duplicating what is already in pygobject and what is in the python standard library, anyway if someone of you guys needs a bit of Glib that has not yet been wrapped let me know.</p>
<p>But what is the reason for the title&#8230;well while wrapping GNode and writing test for it I&#8217;ve been bitten by a segfault that was impossible to track down with both gdb and valgrind, for a couple of days I was trying to segregate the problem writing minimal test cases, but with this small bits of code valgrind and gdb are &#8220;almost&#8221; useless.</p>
<p>The problem has been tracked down using  G_SLICE=debug-blocks as mentioned in <a href="http://blogs.gnome.org/timj/2007/01/02/28122006-g_slicedebug-blocks/">Tim&#8217;s blog</a>, that&#8217;s finally why I owe a beer to Tim.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/gianmt/2007/06/16/i-owe-a-beer-to-tim-janik/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
