<?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>Seán Hayes &#187; python</title>
	<atom:link href="http://seanhayes.name/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanhayes.name</link>
	<description>Web Developer in Rochester, NY (Django, JavaScript, LAMP)</description>
	<lastBuildDate>Fri, 06 Jan 2012 00:45:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Script to Convert PSD Files to HTML Templates</title>
		<link>http://seanhayes.name/2010/12/01/script-convert-psd-files-html/</link>
		<comments>http://seanhayes.name/2010/12/01/script-convert-psd-files-html/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 23:37:59 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[psd2html]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[linux rant]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=208</guid>
		<description><![CDATA[For a while now I&#8217;ve been tinkering with this GIMP Plugin that converts PSD files to HTML templates. There&#8217;s been some recent interest in it, so I&#8217;ve decided to work on it some more and get a usable release out. &#8230; <a href="http://seanhayes.name/2010/12/01/script-convert-psd-files-html/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For a while now I&#8217;ve been tinkering with this <a title="psd2html-gimp-plug-in Repository on GitHub" href="https://github.com/SeanHayes/psd2html-gimp-plug-in" target="_blank">GIMP Plugin that converts PSD files to HTML templates</a>. There&#8217;s been some recent interest in it, so I&#8217;ve decided to work on it some more and get a usable release out.</p>
<p><a href="https://github.com/SeanHayes/psd2html-gimp-plug-in/archives/master" target="_blank">Download psd2html-gimp-plug-in</a></p>
<p><strong>How do I install/use it?</strong><br />
The <a title="psd2html-gimp-plug-in Repository on GitHub" href="https://github.com/SeanHayes/psd2html-gimp-plug-in" target="_blank">project page</a> will have current installation and usage instructions.</p>
<p><strong>What does it do?</strong><br />
The script detects which layers are on top of other layers and what their size and relative positions to each other are. This data is used to arrange the layers into a hierarchy, which can then be expressed as HTML nodes. Each layer is expressed as a &lt;div&gt; element with a unique id based on the layer name, and that id is used to specify the size and position of that element using CSS. Text layers are saved as text within the HTML file, and image layers are extracted to the &lt;template_name&gt;_files/ directory, relative to your PSD file.</p>
<p><strong>Can you port this to Adobe Photoshop?</strong><br />
I think it would be possible to write a similar plugin for Photoshop, but for a large variety of reasons it&#8217;s not very practical. Reasons include: GIMP is <abbr title="Free and Open Source Software">FOSS</abbr> and Photoshop is proprietary; GIMP plugins can be written in Python and I think Photoshop plugins have to be in written in C, C++, or Flash/Flex; based on what I&#8217;ve read on Adobe&#8217;s website I&#8217;d need to get their permission; and I don&#8217;t have Photoshop. Plus, Photoshop and the development tools I&#8217;d need only run on Mac and Windows, and I switched to Ubuntu almost 2 years ago.<br />
I know lots of people prefer Photoshop and hate GIMP. If so you can always do your work in Photoshop and just use GIMP for PSD conversion.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2010/12/01/script-convert-psd-files-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Test Database in Django</title>
		<link>http://seanhayes.name/2010/01/09/test-database-django/</link>
		<comments>http://seanhayes.name/2010/01/09/test-database-django/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 14:27:07 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[test database]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=132</guid>
		<description><![CDATA[At Govnex we&#8217;re using MySQL on our development machines. It has several advantages, but one of the drawbacks is unittests run slower when not using Sqlite (big ups to MockSoul for posting his benchmarks). The reason for this is when &#8230; <a href="http://seanhayes.name/2010/01/09/test-database-django/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At Govnex we&#8217;re using MySQL on our development machines. It has several advantages, but one of the drawbacks is <a title="#8138 (Switch django tests to use transactions)" href="http://code.djangoproject.com/ticket/8138#comment:34">unittests run slower when not using Sqlite</a> (big ups to MockSoul for posting his benchmarks). The reason for this is when running unittests in Django with a Sqlite database, the database is run in memory (RAM) instead of being written to the disk.</p>
<p>Django only allows you to specify one database, and although a new database is created for unittests, <a href="http://docs.djangoproject.com/en/dev/topics/testing/#the-test-database">it still uses most of the same settings</a> (auto prepending &#8220;test_&#8221; to the database name), which means a Django install using MySQL also uses MySQL for unittests.</p>
<p>To get around this problem, I created a file in my project root called test_settings.py containing the following lines:<br />
<script type="text/javascript" src="http://gist.github.com/269919.js?file=test_settings.py"></script></p>
<p>I then opened my settings.py, imported sys, and inserted the following lines at the end of the file:<br />
<script type="text/javascript" src="http://gist.github.com/269919.js?file=settings.py"></script></p>
<p>If one of the command line arguments is &#8220;test&#8221;, that means a unittest is being run, in which case Django will attempt to import test_settings.py, which will override the database settings and use Sqlite instead. <a title="Cross Database Incompatibility Using Django South" href="http://seanhayes.name/2010/01/09/cross-database-incompatibility/">Migrations won&#8217;t be an issue</a>, since Django South uses the old syncdb command for generating databases for unittests.</p>
<p>Hope this helps you save some time testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2010/01/09/test-database-django/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

