<?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>mFabrik - web and mobile development &#187; development tools</title>
	<atom:link href="http://blog.mfabrik.com/category/development-tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Thu, 02 Sep 2010 13:25:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Python code management &amp; deployment &#8211; a glance at zc.buildout and few others</title>
		<link>http://blog.mfabrik.com/2008/09/02/python-code-management-deployment-a-glance-at-zcbuildout-and-few-others/</link>
		<comments>http://blog.mfabrik.com/2008/09/02/python-code-management-deployment-a-glance-at-zcbuildout-and-few-others/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 08:24:47 +0000</pubDate>
		<dc:creator>Tuukka Mustonen</dc:creator>
				<category><![CDATA[development tools]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[zope]]></category>
		<category><![CDATA[buildout]]></category>
		<category><![CDATA[code management]]></category>
		<category><![CDATA[paver]]></category>
		<category><![CDATA[virtualenv]]></category>
		<category><![CDATA[zc.buildout]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=104</guid>
		<description><![CDATA[We&#8217;ve been using zc.buildout for Plone deployment and it&#8217;s working out great. A few days ago implemented a buildout recipe for Django project deployment, automatic web configuration, symlinking, media-folder structuring etc. and while I got it working, I came up with twisted feelings. Buildout is from the creators of Zope (I suppose) so you can [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://pypi.python.org/pypi/zc.buildout/1.1.1">zc.buildout</a> for <a href="http://www.plone.org">Plone</a> deployment and it&#8217;s working out great. A few days ago implemented a buildout recipe for <a href="http://www.djangoproject.org">Django</a> project deployment, automatic web configuration, symlinking, media-folder structuring etc. and while I got it working, I came up with twisted feelings.</p>
<p>Buildout is from the creators of <a href="http://www.zope.org/">Zope</a> (I suppose) so you can expect a powerful project code management tool. The question is, however, whether or not it suits your needs. In my case I found out it too heavy. I mean, to add even a simple task you have to create a new &#8220;recipe&#8221; (a package) that does the tricks. Of course some recipes are generic (found from <a href="http://pypi.python.org">PyPi</a>) and you can just run them with your own INI options, but in my case I had to do some custom implementation. Creating a new python package isn&#8217;t that hard for sure <img src='http://blog.mfabrik.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but there&#8217;s of course some learning curve, so the <em>real</em> question is should you spend time to learn it or not?</p>
<p>I found out that zc.buildout has some nice features like:</p>
<ul>
<li> Automatic requirements processing through setuptools</li>
<li>Automatic (yet simple) removal of directories during recipe uninstall</li>
<li>Clear structure (install(), update() &amp; uninstall() methods)</li>
<li>INI-syntax, python does have a clear syntax but INI is always clearer for a newbie</li>
<li>Easy script creation (adjust python paths somewhat automatically)</li>
<li>Easily repeatable</li>
<li>Passing of arguments from one recipe to another</li>
<li>etc.</li>
</ul>
<p>The problems?</p>
<ul>
<li>It takes a while to learn zc.buildout</li>
<li>It takes &#8216;another while&#8217; to learn to write recipes</li>
<li>Too much hassle for little things</li>
<li>INI-syntax is very limited in features</li>
<li>Buildout easily updates all your packages (that means also the ones you didn&#8217;t want to!)</li>
<li>Lack of documentation (it has good docs to get you going.. but after a while it leaves you with open questions)</li>
<li>Unnecessary overhead (for each script you launch, you&#8217;ll need a launcher script created via buildout)</li>
</ul>
<p>There&#8217;s no denying zc.buildout is powerful, but I wouldn&#8217;t use it for projects which need reasonable amount of customization. It&#8217;s just plain easier and quicker to write shell scripts and while those won&#8217;t provide you with any sort of ready tools you won&#8217;t propably need them. For bringing up somewhat static environment, where you don&#8217;t need to hack things (like that for Plone) it&#8217;s quite a decent option, however.</p>
<p>I also explored alternatives to zc.buildout. I&#8217;ve been reading about earlier virtualenv but haven&#8217;t really tried it out until now. It looks very promising and creates a more flexible environment compared to zc.buildout. Of course their goals are not exactly the same. Also, there are a few other alternatives out there, among them a new Python code management tool called <a href="http://www.blueskyonmars.com/projects/paver/">Paver</a> (just look at that cool logo.. it does remind you of Indiana Jones, does it not?). I glanced through the Paver docs and it looks like it <em>might</em> be the way to go (Paver also supports virtualenv), but didn&#8217;t quite get the grasp of the benefits just yet. Anyway, if you are still interested in code management and deployment, I&#8217;d recommend you to read the <a href="http://www.blueskyonmars.com/2008/04/22/paver-and-the-building-distribution-deployment-etc-of-python-projects/">Paver release announcement</a> and also <a href="http://www.blueskyonmars.com/projects/paver/foreword.html">Paver forewords</a>. They should clear things up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/09/02/python-code-management-deployment-a-glance-at-zcbuildout-and-few-others/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Logging with LogMan</title>
		<link>http://blog.mfabrik.com/2008/06/23/logging-with-logman/</link>
		<comments>http://blog.mfabrik.com/2008/06/23/logging-with-logman/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 14:55:58 +0000</pubDate>
		<dc:creator>Jussi Toivola</dc:creator>
				<category><![CDATA[development tools]]></category>
		<category><![CDATA[pys60]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[logman]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rdebug]]></category>
		<category><![CDATA[s60]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[series 60]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=48</guid>
		<description><![CDATA[This is my first post on our company blog and I thought I&#8217;d tell you something about LogMan, which is developer&#8217;s utility for getting logging messages from Symbian device over a USB cable. It is written by me and mostly on my own time. I started the project because I had to do a Symbian [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first post on our company blog and I thought I&#8217;d tell you something about <a href="http://code.google.com/p/logman-for-symbian/">LogMan</a>, which is developer&#8217;s utility for getting logging messages from Symbian device over a USB cable. It is written by me and mostly on my own time. I started the project because I had to do a Symbian excercise for university course and I thought I&#8217;d do something useful instead of quickly tinkering something small and easy.</p>
<p>LogMan supports both C++ and Python. With LogMan, you can send data to the same location from Python and C++ in real-time instead of using log file(s). Browsing through multiple log files can be tedious and you can&#8217;t see the debug output while using your application, because on Symbian you must read the file after the debugging session &#8211; Symbian cannot share opened files between applications. It is also possible that you create too much log and you run out of Phone internal memory. LogMan helps by removing the use of log files and you never run out of disk space because messages can be stored directly to PC. On simulator, the messages are also sent to <a href="http://wiki.forum.nokia.com/index.php/How_to_use_RDebug">RDebug</a> (%TEMP%\epocwind.out). Surprisingly I have not seen a Python module, which would enable use of RDebug. Even though it is very easy to implement. With RDebug, there is no need to open a serial port on simulator for reading the logging messages.</p>
<p>Of course, I tried to use RDebug on device first, but I never got it working. I also tried <a href="http://www.forum.nokia.com/document/CDL_Extension_S60_3rd_Ed_FP2/GUID-C89505CF-D5FE-4C89-95D4-692443563021/html/classREcmt.html">REcmt</a>, which is supported on S60 only and the service just kept on crashing on my phone. This is why I decided to write LogMan. Plus both are closed software, which effectively prevented me from fixing the problems.</p>
<p>Just wondering what kind of benefit Symbian or Nokia gets from keeping development tools such as these closed? What is there so secret about them? It didn&#8217;t take me very long to write the first working version. *sigh*</p>
<p>The use of LogMan is similar to RDebug. There are static class methods, which are a bit slower but easier, and instance methods. Check the project&#8217;s <a href="http://code.google.com/p/logman-for-symbian/">homepage </a> for more examples.</p>
<p><code><br />
#include "LogMan.h" //RLogMan<br />
RLogMan::Log( _L("Hello world ") );<br />
</code></p>
<p>I recently added a new feature for LogMan, which allows you to log stack and heap usage of the current thread with one function. When you are unsure about your heap or stack usage, these might come handy. Of course there is some memory used when calling these so take that into consideration. Python can access MemoryInfo only, which logs both stack and heap (Well, I got a bit lazy at that point). There are equivalent macros for these, so check them out from &#8220;logmanutils.h&#8221;.</p>
<p><code><br />
// Store this as a member of your class, for example<br />
RLogMan logman;</code></p>
<p>logman.HeapInfo();<br />
logman.StackInfo();<br />
logman.MemoryInfo(); // Both stack and heap<br />
logman.Close();</p>
<p>The output from MemoryInfo is something like this:<br />
<code><br />
StackInfo<br />
Free:1039000, Used:9576, Size:1048576<br />
HeapInfo<br />
Free:25856, Used:101004, Size:126860<br />
</code></p>
<h2>Browser for PyS60</h2>
<p>I have been trying, unsuccessfully, to get Browser Control working on PyS60. In a nutshell, <a href="http://www.forum.nokia.com/document/Cpp_Developers_Library/GUID-96C272CA-2BED-4352-AE7C-E692B193EC06/html/classCBrCtlInterface.html">CBrCtlInterface</a> wrapper for Python. I have developed it against <a href="https://code.launchpad.net/~jussi-toivola/pys60community/browserbranch">PyS60Community</a> version in Launchpad. See /src/appui/appuifw/. I have used LogMan extensively to debug the extension so if you want a real example, check out &#8220;browsercontrol.cpp&#8221;.</p>
<p>Browser Control would allow one to embed a browser into his PyS60 application, which would be quite cool. No need to do user interfaces with &#8220;appuifw&#8221;, which is not very portable. With Browser Control, one could create his user interface with html and javascript, which are a lot more portable indeed. Less work leads to more time. And what is time?&#8230; it&#8217;s money. Or so I have heard. And being able to handle events with Python instead of C++ is another bonus.</p>
<p>Unfortunately, the API is not very stable as you can see by searching for &#8220;CBrCtlInterface&#8221; at Forum Nokia. The browser worked fine on the simulator with small pages such as &#8220;www.google.com&#8221;, but it crashed miserably with larger pages. The crash happens in browsercontrol.dll when calling e32.Ao_sleep() in Python. On device it was unable to open any page and crashed instantly when trying to load one. With LogMan, I was able to verify that the crash happened in e32.Ao_sleep() on device also. This reminds me to test on device all the time, which I didn&#8217;t do for the first versions. But this is why I added the memory logging feature to LogMan, but it only revealed that I was not out of stack or heap. At least not before the browser started to mess around.</p>
<p>I tried to compile the WebKit myself to see what is going on, but the build instructions didn&#8217;t work and the build scripts are written in Perl(my eyes started to hurt). What a mess. I don&#8217;t wonder anymore if there are bugs in browsercontrol.dll. I finally gave up because my idea pool dried up. Any help getting the wrapper working would be very much appreciated.</p>
<h2>Plans for LogMan</h2>
<p>I&#8217;m planning to add remote shell interface so that you could control your phone from PC. I want access to the file system first. Transfer files, list folders and such. If you have TCB rights ( or hacked phone ) you can speed up development remarkably by simply replacing your binaries in \sys\bin or your Python files with new versions. No need to install sis files and fiddle with certificates and play with memory cards. It would be so nice&#8230; I can use 1 day in a week for a personal project so this may happen in near future <img src='http://blog.mfabrik.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/06/23/logging-with-logman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A quick tryout: Documentation Generating for Plone products</title>
		<link>http://blog.mfabrik.com/2007/09/03/a-quick-tryout-documentation-generating-for-plone-products/</link>
		<comments>http://blog.mfabrik.com/2007/09/03/a-quick-tryout-documentation-generating-for-plone-products/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 12:42:22 +0000</pubDate>
		<dc:creator>Tuukka Mustonen</dc:creator>
				<category><![CDATA[Plone (old)]]></category>
		<category><![CDATA[development tools]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[zope]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/2007/09/03/a-quick-tryout-documentation-generating-for-plone-products/</guid>
		<description><![CDATA[Plone is a modular CMS, which can be expanded with additional products. That means new features are easy to install, and also to customize. However, quickly understanding code that other people wrote, might turn tricky as there are as each coder uses his own style. Therefore, it might be useful to get an overall picture [...]]]></description>
			<content:encoded><![CDATA[<p>Plone is a modular CMS, which can be expanded with additional products. That means new features are easy to install, and also to customize. However, quickly understanding code that other people wrote, might turn tricky as there are as each coder uses his own style. Therefore, it might be useful to get an overall picture of the system before diving into details.</p>
<p><a href="http://en.wikipedia.org/wiki/Documentation_generator" title="Documentation Generators">Documentation generators</a> are useful for giving a comprehensive view on code. These are applications that traverse through code and extract information out of it. They use the structured information then to produce a nice looking reference of the code. Ever heard about API? Yep. Ever seen that sort of documentation among any 3rd party Plone product? At least I haven&#8217;t.</p>
<p>Luckily, there a few choices suitable for Plone/Python:</p>
<p><strong>Parsers</strong>: doxygen (generic), epydoc (defines <em>&#8216;epytext&#8217;</em>, parses also others), docutils (defines and parses <em>&#8216;reStructuredText&#8217;</em>)<br />
<strong>Extensions</strong>: graphviz (builds visualization graphs)<br />
<strong>Plugins</strong>: eclox (an Eclipse plugin that uses doxygen, which uses graphviz)</p>
<p>(Plone API&#8217;s at <a href="http://api.plone.org" title="Plone API">api.plone.org</a> use epydoc btw.)</p>
<p>Out of these, I quickly tested doxygen on a Plone product called <a href="http://plone.org/products/easyshop/" title="EasyShop">EasyShop</a>. The result was interesting but without use. EasyShop does only little subclassing and therefore the documentation doxygen produced was basically listings of separate classes and methods. Doxygen uses graphviz to build graphical visualizations of class relations, but those were out of use also. The problem here is that Plone products are not common python packages: they have adapters, utilities, views, events, subscribers and such. Creating dececnt API out of these would need a specific solution targeted at the platform.</p>
<p>Documentation generating seems interesting, however, and graphviz the most providing out of the whole bunch. Unfortunately, I couldn&#8217;t produce anything useful on my first few tries, but the subject just needs a little more research. After all, think about it: an API-like documentation with UML-like graphs of any Plone product, wouldn&#8217;t that be nice?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2007/09/03/a-quick-tryout-documentation-generating-for-plone-products/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
