<?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>dennogumi.org</title>
	<atom:link href="http://www.dennogumi.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dennogumi.org</link>
	<description>On the web since 1999</description>
	<lastBuildDate>Sat, 06 Mar 2010 09:19:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PyKDE4: new style signals and slots</title>
		<link>http://www.dennogumi.org/2010/03/pykde4-new-style-signals-and-slots</link>
		<comments>http://www.dennogumi.org/2010/03/pykde4-new-style-signals-and-slots#comments</comments>
		<pubDate>Sat, 06 Mar 2010 09:04:48 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=763</guid>
		<description><![CDATA[Those who use PyQt and PyKDE4 are certainly familiar with the syntax used to connect signals and slots:

from PyQt4 import QtCore
from PyQt4 import QtGui
from PyKDE4 import kdeui

class MyGUI(QtGui.QWidget):

    def __init__(self, parent=None):
        super(MyGUI, self).__init__(parent)
        self.pushbutton = kdeui.KPushButton()
   [...]]]></description>
			<content:encoded><![CDATA[<p>Those who use PyQt and PyKDE4 are certainly familiar with the syntax used to connect signals and slots:</p>
<pre class="brush: python;">
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyKDE4 import kdeui

class MyGUI(QtGui.QWidget):

    def __init__(self, parent=None):
        super(MyGUI, self).__init__(parent)
        self.pushbutton = kdeui.KPushButton()
        self.pushbutton.setText(&quot;Push me!&quot;)

        QObject.connect(self.pushbutton, QtCore.SIGNAL(&quot;clicked()&quot;),
                               self.button_pushed)

    def button_pushed(self):
        print &quot;Button clicked&quot;
</pre>
<p>The main advantage of this syntax is that it&#8217;s very close to the C++ equivalent, and so you can translate easily from C++ to Python. Unfortunately the advantages of this syntax end here. The disadvantages, at least from a Python coding perspective, outweigh the advantages:</p>
<ul>
<li>It&#8217;s <em>extremely</em> error-prone: make a typo, and not only your signal won&#8217;t be connected, but you won&#8217;t even get a warning, your program will simply do nothing;</li>
<li>In case you have overloaded signals, you have to type the exact signature, going back to the first problem;</li>
<li>It&#8217;s not Pythonic at all.</li>
</ul>
<p>So, in recent PyQt versions (and thus also in PyKDE4) a <em>new style</em> approach was introduced (although the old style is always present should it be the need to). Using the new style, the signals become a property of the object that emits them. and then you use the connect function of that property. Here&#8217;s the example using the new style-signals:</p>
<pre class="brush: python;">
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyKDE4 import kdeui

class MyGUI(QtGui.QWidget):

    def __init__(self, parent=None):
        super(MyGUI, self).__init__(parent)
        self.pushbutton = kdeui.KPushButton()
        self.pushbutton.setText(&quot;Push me!&quot;)
        # New style
        self.pushbutton.clicked.connect(self.button_pushed)

    def button_pushed(self):
        print &quot;Button clicked&quot;
</pre>
<p>As you can see it&#8217;s much clearer, and much more Pythonic. Also, typos  <strong>will</strong> trigger an AttributeError, which means you&#8217;ll be able to track where the problem is.  </p>
<p>What about overloaded signals? Normally the first defined is the default, but you can use a dictionary-like syntax to access other overloads (signal names are completely made up here):</p>
<pre class="brush: python;">
# One signal is without arguments, the other has a bool

# Signal without arguments
self.my_widget.connected.connect(self.handle_errors)
# Signal with a book
self.my_widget.connected[bool].connect(self.handle_errors)
</pre>
<p>Signals are emitted with the emit() function and disconnected with the disconnect() function:</p>
<pre class="brush: python;">
# Emit a signal
self.pushbutton.clicked.emit()
# Emit a signal with a value (an int)
self.my_widget.valueChanged.emit(int)
# Disconnect another
self.my_tabwidget.currentIndexChanged.disconnect()
</pre>
<p>To define new signals, you can use the <em>pyqtSignal</em> function, specifying which values will the signal take (if any): just define that as a class constant (like in the example) and then you can access them like the wrapped ones:</p>
<pre class="brush: python;">

class MyWidget(QWidget):

    # Signal with no arguments
    operationPerformed = QtCore.pyqtSignal()

    # Signal that takes arguments
    valueChanged = QtCore.pyqtSignal(int)
</pre>
<p>I merely scratched the surface with this. For more information, check out <a href="http://riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html" title="PyQt4 Reference Manual">PyQt&#8217;s reference manual</a>, which also covers other cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/03/pykde4-new-style-signals-and-slots/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The world of KIO metadata &#8211; checking the HTTP response from a server</title>
		<link>http://www.dennogumi.org/2010/02/the-world-of-kio-metadata-checking-the-http-response-from-a-server</link>
		<comments>http://www.dennogumi.org/2010/02/the-world-of-kio-metadata-checking-the-http-response-from-a-server#comments</comments>
		<pubDate>Thu, 18 Feb 2010 21:42:46 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=753</guid>
		<description><![CDATA[Recently, I investigated how to perform some checks on web addresses using KIO for Danbooru Client. My old code was synchronous, so it blocked the application while checking, thus causing all sort of troubles (UI freezing, etc.). Therefore, making the switch to KIO was the best solution. However, I had one problem: how could I [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I investigated how to perform some checks on web addresses using KIO for <a href="http://kde-apps.org/content/show.php/Danbooru+Client?action=content&#038;content=114343" title="kde-apps page">Danbooru Client</a>. My old code was synchronous, so it blocked the application while checking, thus causing all sort of troubles (UI freezing, etc.). Therefore, making the switch to KIO was the best solution. However, I had one problem: <em>how could I check the HTTP response?</em></p>
<p>I knew already that the various ioslaves can store metadata, consisting of key-value pairs which are specific on the slave used. Normally you can get the whole map by accessing the <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/kio/html/classKIO_1_1Job.html#a631cbc61c70e512ad91b2cf2c23ef029" title="API docs on metaData()"><em>metaData</em></a> function of the job you have used, in the slot connected from the <em>result</em> signal.  For some reason, however, in PyKDE4 calling metaData() triggers an assert in SIP, which ends in a crash (at least in my application; I stil need to debug further).  KIO  jobs have also the <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/kio/html/classKIO_1_1Job.html#aafd31b4d9643bffb4cd75f3a31242bd4" title="API docs on queryMetaData"><em>queryMetaData</em></a> function, which returns the value of the key you have queried. Unfortunately, there was no way I could find the name.</p>
<p>Thus began my search for the right key. Googling didn&#8217;t help, and on IRC I got the first answers I needed but not enough to reach the goal. Until I saw a commit by David Faure in trunk/kdelibs/kio/ which touched a file called <a href="http://websvn.kde.org/branches/KDE/4.4/kdelibs/kio/DESIGN.metadata?revision=1070858&#038;view=markup" title="Link to the branch version">DESIGN.metadata</a> (link is for the branch version). After checking with webSVN, that was exactly the thing I was looking for! It lists all the keys for the metadata, indicating also to which ioslave they begin.  After that, the solution was easy.</p>
<p>Of course I&#8217;m not leaving you hanging there and now I&#8217;ll show you how, in PyKDE4, you can quickly check for the server response:</p>
<pre class="brush: python;">
from PyKDE4.kio import KIO
from PyQt4.QtCore import SIGNAL
[...]

class my_widget(QWidget):
[...]

    def check_address(self, url):

        # You can add optional flags such as KIO.HideProgressInfo
        job = KIO.get(KUrl(url))
        self.connect(job, SIGNAL(&quot;result (KJob *)&quot;), self.slot_result)

    def slot_result(self, job):

        if job.error():
            # Bail out if there's an error
            return    

        # Get the HTTP response through queryMetaData
        http_response = job.queryMetaData(&quot;responsecode&quot;)
        print &quot;Got response: %s&quot; % unicode(http_response)
</pre>
<p>This snippet does a few things. Firstly, it gets the specified URL, using KIO.get (KIO.stat doesn&#8217;t set the required metadata). Notice that the call is not wrapped in the  new-style PyQt API because <em>result (KJob *)</em> isn&#8217;t wrapped like that (<a href="https://bugs.kde.org/show_bug.cgi?id=211070" title="Bug 211070">there&#8217;s a bug open for that</a>). In any case, the signal passes to the connecting slot (slot_result) where we first check if there&#8217;s an error (perhaps the address didn&#8217;t exist?) and then we use <em>queryMetaData(&quot;responsecode&quot;)</em> to get the actual response code. </p>
<p>If you want to do error checking basing on the result, bear in mind that KIO operates asynchronously, so you should use a signal to tell your application that the result is what it expected or not.</p>
<p>I wonder if this should be documented in Techbase&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/02/the-world-of-kio-metadata-checking-the-http-response-from-a-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ar Tonelico III</title>
		<link>http://www.dennogumi.org/2010/02/ar-tonelico-iii</link>
		<comments>http://www.dennogumi.org/2010/02/ar-tonelico-iii#comments</comments>
		<pubDate>Sat, 06 Feb 2010 21:33:20 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[Anime]]></category>
		<category><![CDATA[ar tonelico 3]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=748</guid>
		<description><![CDATA[
It&#8217;s been a while since I blogged about anything non-FOSS. This time I&#8217;ll be sharing some impressions on one of the games I&#8217;m playing at the moment, that is, Ar Tonelico III (which arrived at my doorstep two days ago). I admit I haven&#8217;t been a fan of Gust games (aside from Ar Tonelico, they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p><img title="Ar Tonelico III cover" src="http://www.dennogumi.org/wp-content/uploads/2010/02/ar_3.jpg" alt="Ar Tonelico III cover image" /></p>
<p>It&#8217;s been a while since I blogged about anything non-FOSS. This time I&#8217;ll be sharing some impressions on one of the games I&#8217;m playing at the moment, that is,<strong> Ar Tonelico III</strong> (which arrived at my doorstep two days ago). I admit I haven&#8217;t been a fan of Gust games (aside from Ar Tonelico, they&#8217;re known mostly for the <em>Atelier</em> series), mostly because technically wise they didn&#8217;t really perform that well. While I understood they&#8217;re a small company, sometimes it was a little too much.</p>
<p>I bought this one because from the movies and information disseminated throughout the net it looked like it was better, so I started reading information, which in turn prompted the buy: it&#8217;s also a good way to keep my Japanese in order, as I need to keep up with the language if I want to understand things.</p>
<p>Right now I&#8217;ve just played a couple of hours, and it looks decent, although with some technical issues (the characters glide over the terrain, rather than walk). I&#8217;ve also seen the infamous <em>Purge System</em> in action (look it up online), which made quite a number of fan sneer for a various number of reasons. As of the story, I can&#8217;t say anything at the moment: I&#8217;ve just started. At least it is moderately fun.</p>
<p><a title="Hands-on" href="http://forum.everyeye.it/invision/index.php?showtopic=527861">Here&#8217;s a hands-on</a> (Italian) which covers more details. I&#8217;ll try to post a few updates in the future (if I don&#8217;t forget&#8230;.)</p>
<p>And here&#8217;s a quick video I made with my camera:</p>
<p><a href="http://www.dennogumi.org/2010/02/ar-tonelico-iii"><em>Click here to view the embedded video.</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/02/ar-tonelico-iii/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.heavensinferno.net/downloads/tonelico3_conv.flv" length="8569353" type="video/x-flv" />
		</item>
		<item>
		<title>Learning by example</title>
		<link>http://www.dennogumi.org/2010/01/learning-by-example</link>
		<comments>http://www.dennogumi.org/2010/01/learning-by-example#comments</comments>
		<pubDate>Wed, 13 Jan 2010 21:37:38 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pykde]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=744</guid>
		<description><![CDATA[With my brand-new SVN account, I just committed some code to kdeexamples, KDE&#8217;s example code module. In particular, I  committed a simple example which shows how to use KConfigXT via PyKDE4, a simplified version of what I wrote about here.
As most of KDE is C++, and the Python API docs are translated directly from [...]]]></description>
			<content:encoded><![CDATA[<p>With my brand-new SVN account, <a href="http://lists.kde.org/?l=kde-commits&#038;m=126342017923323&#038;w=2" title="SVN commit">I just committed some code</a> to kdeexamples, KDE&#8217;s example code module. In particular, I  committed a simple example which shows how to use KConfigXT via PyKDE4, a simplified version of <a href="http://www.dennogumi.org/2009/10/howto-kconfigxt-with-pykde4" title="HOWTO: KConfigXT with PyKDE4">what I wrote about here</a>.</p>
<p>As most of KDE is C++, and the Python API docs are translated directly from the C++ API docs, it is essential to have good examples to help newcomers learn faster.  There are some PyKDE4 examples in the kdebindings module already, but I put mine in kdeexamples for a number of reasons:</p>
<ul>
<li><em>Clear purpose</em>: kdeexamples is meant exactly for this &#8211; example code;</li>
<li><em>Visibility:</em> A central place to find KDE examples even for bindings is optimal, makes easier to find what one is looking for.</li>
</ul>
<p>Visibility is also important as currently the examples are rather buried inside kdebindings, and as far as I know they aren&#8217;t included in the packages of some distributions (at least not openSUSE; YMMV). </p>
<p>I decided to take this route because PyKDE4 is basically the job of one person (Simon Edwards): he does already a great job, but the work is too much for a single person to handle. And due to shortage of human resources, PyKDE4 lacks examples and documentation, and thus it&#8217;s not always easy to understand how to use the C++ API in Python. Writing snippets of working code, with extensive comments, is a step in the good direction. And also an opportunity to contribute back to KDE after all these years!</p>
<p>For now there&#8217;s just KConfigXT,  but I plan on tackling KIO next, as soon as I have time. Of course, help is welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/01/learning-by-example/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Danbooru Client 0.5 is out</title>
		<link>http://www.dennogumi.org/2009/12/danbooru-client-0-5-is-out</link>
		<comments>http://www.dennogumi.org/2009/12/danbooru-client-0-5-is-out#comments</comments>
		<pubDate>Sun, 27 Dec 2009 08:54:54 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[Anime]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[danbooru client]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=738</guid>
		<description><![CDATA[Sometimes answering apparently harmless questions on instant messaging can have unexpected results. In particular, I was telling about Danbooru Client to someone and a question popped up &#34;Why don&#8217;t you support pages?&#34;. It seemed a nice idea, so I branched off the code (yay for git!) and started working on it.
Well, it took me more [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes answering apparently harmless questions on instant messaging can have unexpected results. In particular, I was telling about Danbooru Client <a href="http://www.clorophilla.net/blog" title="NRK's blog">to someone</a> and a question popped up &quot;Why don&#8217;t you support pages?&quot;. It seemed a nice idea, so I branched off the code (yay for git!) and started working on it.</p>
<p>Well, it took me more than a <em>month</em> to get this thing done&#8230; I didn&#8217;t spend every day coding, but it was a challenge. Glad it&#8217;s over now, which means that Danbooru Client 0.5 is finally available. Grab it <a href="http://kde-apps.org/content/show.php/Danbooru+Client?content=114343" title="kde-apps page">at the usual place on kde-apps.org</a>. </p>
<p>Changes in this version:</p>
<ul>
<li>Massive code refactoring and documentation</li>
<li>Support for multiple pages: the same query can be repeated multiple pages (shown in a tabbed interface), kind of like browsing the actual Danbooru board;</li>
<li>Rating information added to the API;</li>
<li>Support for translations (thanks to Pino &quot;pinotree&quot; Toscano for the help): the tarball now contains a .pot file which can be used for translating Danbooru Client. If you make a translation, send the .po file my way and I&#8217;ll include it in the next version.</li>
</ul>
<p>Improvements that I have in the queue:</p>
<ul>
<li>Suppport for pools (every board out there changes the API, so it will require some work);</li>
<li>Support for storing password/username using KWallet (through <a href="http://pypi.python.org/pypi/keyring" title="keyring at PyPi">python-keyring</a>, so it works even without KWallet installed);</li>
<li>Review usability of the dialogs (I have a separate branch for that);</li>
<li>Improve the image download dialog.</li>
</ul>
<p>On recent KDE SC versions (4.4 beta 2 and onwards) there are some painting issues with regards to the thumbnails, but I&#8217;m not sure if the fault is in PyKDE4 or in the underlying libraries. Nothing too bad, luckily: hovering the thumbnails or giving focus to the thumbnail view should be what&#8217;s needed. </p>
<p>Here&#8217;s a screenshot of the new interface (click to enlarge):</p>
<p align="center"><a href="http://www.dennogumi.org/wp-content/uploads/2009/12/danbooru_new.png"><img src="http://www.dennogumi.org/wp-content/uploads/2009/12/danbooru_new_resized.png" title="The new interface" alt="Screenshot of the new interface" /></a></p>
<p>Comments and suggestions are always welcome, so don&#8217;t hesitate to drop me a line.</p>
<p>As a final word, some thoughts on the work required to get this out of the door. My largest issues are related to garbage collection: Python&#8217;s reference counting based GC got a lot in the way, at least because of how the underlying C++ structures work. I had to work a bit to keep references to objects around so I wouldn&#8217;t get crashes (accessing an already deleted object). All is well now, and I think my Python/PyQt/PyKDE4 knowledge gained from it. I keep telling myself that I should be writing some tutorials one day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/12/danbooru-client-0-5-is-out/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Living on the edge</title>
		<link>http://www.dennogumi.org/2009/12/living-on-the-edge</link>
		<comments>http://www.dennogumi.org/2009/12/living-on-the-edge#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:29:35 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=727</guid>
		<description><![CDATA[KDE SC 4.4 Beta 1 has been released, and of course I couldn&#8217;t stay still. Thanks to the friendly openSUSE Build Service, there were packages available, so I just pointed my zypper sources to KDE:KDE4:UNSTABLE:Desktop repository, adjusted a few other things (mainly other third-party repositories) and updated.

It was a mostly painless process, mostly because I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dot.kde.org/2009/12/04/kde-software-compilation-44-beta-1-released" title="Dot story">KDE SC 4.4 Beta 1</a> has been released, and of course I couldn&#8217;t stay still. Thanks to the friendly <a href="http://build.opensuse.org" title="OBS link">openSUSE Build Service</a>, there were packages available, so I just pointed my zypper sources to <a href="http://download.opensuse.org/repositories/KDE:/KDE4:/UNSTABLE:/Desktop" title="Repository link">KDE:KDE4:UNSTABLE:Desktop</a> repository, adjusted a few other things (mainly other third-party repositories) and updated.</p>
<p><span id="more-727"></span></p>
<p>It was <em>a mostly painless</em> process, mostly because I was too fast, and the mirrors hadn&#8217;t synced yet, so I ended up with 4.3.77 packages instead of 4.3.80 (Beta 1). I just avoided to log into X and waited till the right packages were available, then I updated again. I updated system-wide (yes, I can be <em>that</em> crazy) and I started using the beta (and its subsequent snapshots) full time. In part it&#8217;s because I&#8217;m a feature addict, in part because I wanted to write some promo material (I&#8217;m really sorry Jos, I didn&#8217;t find the time to do it yet!) to make things easier prior to release. </p>
<p>So, how&#8217;s the SC faring, so far? Pretty nice, overall. There are of course quirks (for example KWin not responding to global shortcuts unless it&#8217;s restarted), but generally the experience has been quite positive. The user-facing components, such as KWin and Plasma, have improved quite a bit (new effects, the new widget explorer, new applets&#8230;.), but also less visible parts such as Nepomuk (with the Virtuoso backend it works OK, although for some reason I can&#8217;t access the metadata panel in Dolphin or use the search, also in Dolphin). I also took the time to explore other applications, for example Cantor, as I&#8217;m a (reluctant) user of the R programming language. The version built by openSUSE doesn&#8217;t ship with an R backend, so I had to compile it on my own. It is more minimalistic than, say, <a href="http://rkward.sourceforge.net" title="rkward link">rkward</a>, but I can foresse already some uses for it (especially running already-made scripts).</p>
<p>I also tried out the netbook shell on my Eee. Again, it&#8217;s pretty nice, although sometimes the performance is still lacking (but my Eee uses an i915 chipset, so it&#8217;s really the end-of-line and may have played a role in this. </p>
<p>Overall I&#8217;m very impressed, so congratulations to everyone who&#8217;s making this possible!</p>
<p>Lastly, following up what <a href="http://www.asinen.org/2009/12/ill-show-you-mine/" title="I'll show you mine">Stuart</a> and others did, here are two screenshots of two of my (many) activities (click for full picture):</p>
<p align="center"><a href="http://www.dennogumi.org/wp-content/uploads/2009/12/activity1_full.png"><img src="http://www.dennogumi.org/wp-content/uploads/2009/12/activity1_thumb.jpg" /></a></p>
<p align="center"><a href="http://www.dennogumi.org/wp-content/uploads/2009/12/activity2_full.png"><img src="http://www.dennogumi.org/wp-content/uploads/2009/12/activity2_thumb1.jpg" /></a></p>
<p align="center">
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/12/living-on-the-edge/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>After a hiatus, Klassrooms continue!</title>
		<link>http://www.dennogumi.org/2009/11/after-a-hiatus-klassrooms-continue</link>
		<comments>http://www.dennogumi.org/2009/11/after-a-hiatus-klassrooms-continue#comments</comments>
		<pubDate>Sun, 29 Nov 2009 22:25:34 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[kdeforum]]></category>
		<category><![CDATA[klassroom]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/2009/11/after-a-hiatus-klassrooms-continue</guid>
		<description><![CDATA[Do you like KDE? Did you ever find yourself in a position of wanting to help, but you didn&#8217;t know what to do, or who to talk to? Do you feel you could use help to get started?
Today, the KDE Community Forums would like to provide the opportunity to answer those questions by annoucing the [...]]]></description>
			<content:encoded><![CDATA[<p>Do you like KDE? Did you ever find yourself in a position of wanting to help, but you didn&#8217;t know what to do, or who to talk to? Do you feel you could use help to get started?</p>
<p>Today, the KDE Community Forums would like to provide the opportunity to answer those questions by annoucing the continuation of the tutorial courses known as <em>Klassrooms</em>.</p>
<h2>What are Klassrooms?</h2>
<p>Klassrooms are tutorial &#8220;lessons&#8221; held in a specific area of the forum. Held by one or more &#8220;mentors&#8221;, they are focused in guiding people through helping KDE by tackling a particular problem. Examples of such problems include:</p>
<ul>
<li>Fixing simple bugs in an application</li>
<li>Taking junior jobs in a specific project</li>
<li> Helping with documentation</li>
<li> Promotion work (for example, screencasts)</li>
<li> Helping with translations</li>
</ul>
<p>As you can see, Klassrooms are not limited to coding at all.</p>
<p>Usually the sessions last from one to two weeks, with a maximum of 5 &#8220;students&#8221; participating. The work is coordinated in a specific area of the forum.</p>
<h2>Public call for mentors</h2>
<p>The key to hold Klassrooms is having mentors. Their role is to present the problem and guide students through the course. Compared to a live session, using the forum requires less time, and both the students and the mentor can set their most convenient schedule.</p>
<p>That is why <em>we need you! </em>You don&#8217;t need to be a developer: non-coding courses are as welcome as coding ones. How do you become a mentor? <a href="http://forum.kde.org/viewtopic.php?f=71&#038;t=84115">These guidelines</a> explain everything that is needed to apply. </p>
<p>If you feel like helping, this is the perfect opportunity. Let us know!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/11/after-a-hiatus-klassrooms-continue/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>KDE Marketing Sprint &#8211; Day 2(?)</title>
		<link>http://www.dennogumi.org/2009/11/kde-marketing-sprint-day-2</link>
		<comments>http://www.dennogumi.org/2009/11/kde-marketing-sprint-day-2#comments</comments>
		<pubDate>Sat, 14 Nov 2009 23:26:28 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/2009/11/kde-marketing-sprint-day-2</guid>
		<description><![CDATA[Well, there wasn&#8217;t a Day 1 for me (I got to the hotel too late to follow the first day of the meeting), so that is why I&#8217;m starting on day 2. To start, I need to say that I had never been to a sprint before: I am already accustomed to meeting for real [...]]]></description>
			<content:encoded><![CDATA[<p>Well, there wasn&#8217;t a Day 1 for me (I got to the hotel too late to follow the first day of the meeting), so that is why I&#8217;m starting on day 2. To start, I need to say that I had never been to a sprint before: I am already accustomed to meeting for real someone from online, but for all the attendants, they had been just names or nicks on IRC. That means I was a bit nervous.</p>
<p>The first encounter worked out pretty well, actually. I went with the others to have a dinner out, and I got to talk to &#8220;famous&#8221; KDE people such as Troy, Lydia, or Jos. I also had the nice opportunity to meet up with my fellow forum administrator neverendingo, and we discussed a bit on how to improve the forums. In short, the evening was really nice. I even got to see a N900! I thought I&#8217;d never see that. A very nice piece of hardware, I&#8217;d say.</p>
<p>The following morning, aside a little incident (the other people forgot about me!) I walked up to KONSEC where the meeting was held. While Cornelius led the discussion (the Dot will have more details in due time), I worked on helping out with a promo booklet the team is making. I&#8217;m used to writing, but writing in an appealing way to a less specialized audience is much harder. Thanks go to Jos who got me on the right track.</p>
<p>Then  part of the people moved to another room to discuss about getting new contributors to KDE while I stayed with Jos and Stuart to work on other material. It was a little draining, but very productive overall. I am actually happy to be part of this, for a change, rather than passively reading about it on the web. It&#8217;s nice to give something back to your favorite project, as little as may be. </p>
<p>Lastly, we went out for a dinner in an Indian restaurant (nice food, not too much though), and we went back (with Eckhart showing us innovative ways to get back by changing multiple subway trains). And here I am, writing a small report of this day.</p>
<p>It&#8217;s been a very positive experience so far. I finally saw more people who use KDE, and they&#8217;re also both fun and nice. Now it&#8217;s time for bed, I still have a good half of a day for work before I get back.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/11/kde-marketing-sprint-day-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Danbooru Client &#8211; a client for Danbooru based sites</title>
		<link>http://www.dennogumi.org/2009/10/danbooru-client-a-client-for-danbooru-based-sites</link>
		<comments>http://www.dennogumi.org/2009/10/danbooru-client-a-client-for-danbooru-based-sites#comments</comments>
		<pubDate>Sun, 25 Oct 2009 20:16:50 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[Anime]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[danbooru]]></category>
		<category><![CDATA[pykde]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/2009/10/danbooru-client-a-client-for-danbooru-based-sites</guid>
		<description><![CDATA[A while ago I presented &#8220;danbooru2nepomuk&#8221;, a small program to tag images coming from Danbooru-based image boards. Today I want to present the evolution of that program, that is a PyKDE4 client for those boards.

Danbooru? Is it something you eat?
Well, aside from the Wikipedia link above, I think a small introduction is in order, at [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I presented <a href="http://www.dennogumi.org/2009/10/danbooru2nepomuk-a-nepomuk-tagger-for-danbooru-images" title="danbooru2nepomuk entry">&#8220;danbooru2nepomuk&#8221;</a>, a small program to tag images coming from <a href="http://en.wikipedia.org/wiki/Imageboard#Danbooru-style_boards" title="Wikipedia link">Danbooru-based image boards</a>. Today I want to present the evolution of that program, that is a PyKDE4 client for those boards.</p>
<p><span id="more-708"></span></p>
<h1>Danbooru? Is it something you eat?</h1>
<p>Well, aside from the Wikipedia link above, I think a small introduction is in order, at least for the readers coming from PlanetKDE. Danbooru is a kind of image board which structures its data semantically, by having tags attached to images (along with other things, such as favorites, rating, etc.). It can be browsed normally (newest posts, etc.) or by using tags and other properties. Some boards are quite popular in the anime-viewing community. The neat thing about Danbooru (which is by itself a Ruby on Rails application) is the fact that it can provide a REST and POST API to access data. So. it&#8217;s technically possible to access such boards programmatically: the API permits not only retrieving posts, but also upload, tag, and perform other operations.</p>
<p>The API could be technically used also for client applications, in order to free the user from using a browser. That is what Danbooru Client is aiming to do.</p>
<h1>Introducing Danbooru Client</h1>
<p>Danbooru Client fits exactly these needs by providing a GUI to (part of) the Danbooru API.</p>
<p><strong>Features:</strong></p>
<ul>
<li> Connect to any Danbooru board (three predefined)</li>
<li>Download up to 100 images with selectable tags;</li>
<li>Download or view images with the KDE preferred image viewer;</li>
<li>Tag semantically the images using Nepomuk.</li>
</ul>
<p><strong>Requirements:</strong></p>
<ul>
<li>PyQt (at least version 4.5)</li>
<li>PyKDE4 (tested with PyKDE 4.3 only)</li>
<li>(optional) Nepomuk</li>
<li>Python (at least version 2.5)</li>
</ul>
<p><strong>Screenshots</strong></p>
<p align="center"><a href="http://www.dennogumi.org/wp-content/uploads/2009/10/danb_client1.png"><img src="http://www.dennogumi.org/wp-content/uploads/2009/10/danb_client1_resized.png" /></a> <a href="http://www.dennogumi.org/wp-content/uploads/2009/10/danb_client2.png"><img src="http://www.dennogumi.org/wp-content/uploads/2009/10/danb_client2_resized.png" /></a></p>
<p align="center">(click to enlarge)</p>
<h2>Download &amp; Installation</h2>
<p>You can obtain Danbooru Client <a href="http://www.kde-apps.org/content/show.php/Danbooru+Client?content=114343">from kde-apps.org</a>. For the bleeding edge people (but are there such users for such an application?) there is a <a href="http://gitorious.org/danbooru-client/danbooru-client">git repository set up at Gitorious</a>. Once downloaded, you need to use CMake to install the files. Unfortunately due to the way CMake is set up, you&#8217;ll need the KDE development headers and a working C++ compiler, even though you won&#8217;t need them for the installation.</p>
<p>The installation process is very straightforward:</p>
<p><pre class="brush: bash;">cd /path/to/source
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ../
make # This just byte-compiles Python files
sudo make install</pre>
</p>
<p>Then, just launch &#8220;danbooru_client&#8221;.</p>
<h2>Known limitations</h2>
<p>There are plenty for now, it&#8217;s just version 0.1:</p>
<ul>
<li>Zero documentation (although it&#8217;s kind of straightforward to use)</li>
<li>Empty cells are created when a row is not filled with images</li>
<li>No support for multi-download</li>
<li>Untested login/password access</li>
<li>The interface may be horrid</li>
<li>Danbooru does not support rating filtering via API, so it&#8217;s not currently possible to do so</li>
</ul>
<p>The client is licensed under the GPL v2 or later. The artwork for the splash screen is also under the GPL and was made by <a href="http://www.melissaadkins.com">Melissa Adkins</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/10/danbooru-client-a-client-for-danbooru-based-sites/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>HOWTO: KConfigXT with PyKDE4</title>
		<link>http://www.dennogumi.org/2009/10/howto-kconfigxt-with-pykde4</link>
		<comments>http://www.dennogumi.org/2009/10/howto-kconfigxt-with-pykde4#comments</comments>
		<pubDate>Mon, 19 Oct 2009 21:43:10 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pykde]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=687</guid>
		<description><![CDATA[If you read around the KDE Techbase, or if you develop KDE applications, you may have heard about KDE&#8217;s KConfigXT. This is an extension of KDE&#8217;s KConfig, and can be used to generate nice configure dialogs with multiple pages with minimal effort, also taking care of saving and applying settings. In short, something really neat! [...]]]></description>
			<content:encoded><![CDATA[<p>If you read around the <a href="http://techbase.kde.org">KDE Techbase</a>, or if you develop KDE applications, you may have heard about KDE&#8217;s <a href="http://techbase.kde.org/Development/Tutorials/Using_KConfig_XT">KConfigXT</a>. This is an extension of KDE&#8217;s KConfig, and can be used to generate nice configure dialogs with multiple pages with minimal effort, also taking care of saving and applying settings. In short, something really neat! But there are problems when using it with interpreted language bindings (such as PyKDE, which is the one I use):</p>
<ul>
<li>KConfigXT requires an XML file and an INI-like file to be compiled by kconfig_compiler in order to produce C++ files</li>
<li>There is no such a tool (at least to my knowledge) that does the same job for bindings</li>
</ul>
<p>So what to do? Either give up on the niceness of KConfigXT, or work around the issue. I chose the latter. </p>
<p><span id="more-687"></span></p>
<h2>Bypassing the kconfig_compiler limitation</h2>
<p>What kconfig_compiler does is basically generate the KConfigSkeleton sublcass needed for KConfigXT. So, we can create our own subclass by hand: a little more work is involved but nothing too hard. The following snippets, taken from a GPL application I&#8217;m working on, will demonstrate how to do it. </p>
<pre class="brush: python;">
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.kdeui import *

#UI stuff - see later
from ui_generalpage import Ui_GeneralPage

class Preferences(KConfigSkeleton):

    &quot;&quot;&quot;Class to handle preferences.&quot;&quot;&quot;

    def __init__(self, *args):
        super(Preferences, self).__init__(self, *args)
        self.setCurrentGroup(&quot;General&quot;)
        self._danbooru_boards_list = QStringList()
        self._danbooru_boards = self.addItemStringList(&quot;danbooruUrls&quot;,
                                                       self._danbooru_boards_list,
                                                       QStringList())
</pre>
<p>Here we set up a KConfigSKeleton subclass. The first thing we set up after that is the config group we want to use: we can have several, for example &#8220;General&#8221;, &#8220;Services&#8221;, and so on. Of course an empty group makes nothing, so we populate it, in this case with a QStringList configuration item (<a href="http://api.kde.org/4.3-api/kdelibs-apidocs/kdecore/html/classKCoreConfigSkeleton.html">see the API docs</a> (KCoreConfigSkeleton, but KConfigSkeleton is a subclass of that) for more types you can use). You&#8217;ll notice that we assign an empty QStringList to a variable, which is then used in the addItemStringList call later. That&#8217;s because KConfigSkeleton (in C++) wants a pointer to the type of content, and since in Python we don&#8217;t have pointers, we pass a reference (and by binding it to our class instance, we make sure it won&#8217;t be garbage-collected). </p>
<p>The addItemStringList (and other addItem*) methods use three parameters: a string with the name of the option (remember this!), the reference to the item, and a default value (in this case an empty QStringList).. Once we&#8217;ve set the options, we call readConfig() in the initializer to make sure the values are read from the config (or default values created).</p>
<p>I set all the attributes as &#8220;hidden&#8221; to prevent direct manipulation. To access them, I set up properties (following the example of minirok, another PyKDE4 application). </p>
<pre class="brush: python;">
    @property
    def boards_list(self):
        return self._danbooru_boards.value()
</pre>
<p>As you can see, the value of the configuration items is accessed via the value() function. Once tihs is done, we&#8217;re done with regards to the KConfigSkeleton part.</p>
<h2>KConfigDialog</h2>
<p>Of course now we want to create the config dialog. We do so by subclassing KConfigDialog. First, though, we must create the page contents. We do so in Qt Designer. We first create a widget, and then we place our configuration widgets on it. It is <strong>essential</strong> that the widget that will store our configuration details have the name <em>kcfg_CONFIGOPTION</em>, where CONFIGOPTION is the name you specified as a string in the KConfigSkeleton initializer. Once done, we save the ui file, compile with pykdeuic4, we set it in the imports of our preferences file and we&#8217;re good to go. </p>
<p>The following is an example of a general configuration page widget (the UI_* is the pykdeuic4 generated file):</p>
<pre class="brush: python;">
class GeneralPage(QWidget, Ui_GeneralPage):

    def __init__(self, parent=None, preferences=None):
        super(GeneralPage, self).__init__(parent)
        self.setupUi(self)

        self.kcfg_danbooruUrls.insertStringList(preferences.boards_list)
</pre>
<p>As you can see, we pass the preferences instance in the initializer, so we can populate the widgets (which are indeed named kcfg_danbooruUrls, just like the config option I set earlier) . Of course you can connect signals and whatnot to slots in case you want to do something with your widgets. I didn&#8217;t have the need, so no need to. </p>
<p>And once we have this set up, we can finally create the KConfigDialog! </p>
<pre class="brush: python;">
class PreferencesDialog(KConfigDialog):

    def __init__(self, parent=None, name=None, preferences=None):
        super(PreferencesDialog, self).__init__(parent, name, preferences)

        self.setButtons(KDialog.ButtonCode(KDialog.Ok |KDialog.Apply |
                                            KDialog.Cancel))

        self.general_page = GeneralPage(self, preferences)
        self.general_page_item = self.addPage(self.general_page, 'General')
</pre>
<p>In the initializer, we pass the preferences instance, the name (used later to determine if a page is already open, since KConfigDialog is non-modal), and of course, the parent widget. We then set the buttons (using bitwise ORs) we want to show. Finally, we instantiate our page widget and add it to the dialog, specifying a name that will appear on the side. Using the setIcon method you can also set an icon for your page. In case you want to perform checks and other things, reimplement slotButtonClicked in your subclass with (self, button) as parameters. But dont&#8217; forget to call the original KConfigDialog.slotButtonClicked(button) in that case.</p>
<h2>Wrapping it up: calling KConfigDialog</h2>
<p>Finally, how to call your dialog? First of all, you need to instantiate your preferences object, for example in your main window application code:</p>
<pre class="brush: python;">self.preferences=preferences.Preferences()</pre>
<p>Then, in your code, you do something like this:</p>
<pre class="brush: python;">
if KConfigDialog.showDialog(&quot;Preferences dialog&quot;):
    return
else:
    dialog = preferences.PreferencesDialog(self, &quot;Preferences dialog&quot;,
                                           self.preferences)
    dialog.show()
</pre>
<p>The first if ensures that if there is already one dialog open, it won&#8217;t open another. If that&#8217;s not the case, we instantiate the dialog, passing it the name (which must be the same as the if above), the parent, and the preferences instance. </p>
<p>Voila&#8217;. In the end, you&#8217;ll get something like this (slightly different):</p>
<p align="center"><img src="http://www.dennogumi.org/wp-content/uploads/2009/10/kconfigdialog_small.jpg" title="Example KConfigDialog" alt="Image of the example KConfigDialog" /></p>
<p>I know my own UI sucks here, but it&#8217;s something I&#8217;m still experimenting&#8230;</p>
<p>For this tutorial, thanks go to Pino &#8220;pinotree&#8221; Toscano, who pointed me to the &#8220;minirok&#8221; project, which makes use of KConfigXT, and Adeodato Simò, the author of minirok.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/10/howto-kconfigxt-with-pykde4/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
