<?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>Tom Coote &#187; Productivity</title>
	<atom:link href="http://tomcoote.co.uk/category/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://tomcoote.co.uk</link>
	<description>An ace web developer!</description>
	<lastBuildDate>Sun, 08 Jan 2012 14:18:38 +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>Easy links to disallowed web pages</title>
		<link>http://tomcoote.co.uk/productivity/easy-links-to-disallowed-web-pages/</link>
		<comments>http://tomcoote.co.uk/productivity/easy-links-to-disallowed-web-pages/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 23:20:59 +0000</pubDate>
		<dc:creator>Tom Coote</dc:creator>
				<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://tomcoote.co.uk/?p=409</guid>
		<description><![CDATA[
			
				
			
		
Have you ever looked at the robots.txt file of a web site? They exist so that web sites can stop search engines and other similar robots from indexing web pages on a web site. However they are often used to hide web pages on live web sites that the web site owners don&#8217;t want people [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-top:10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Feasy-links-to-disallowed-web-pages%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Feasy-links-to-disallowed-web-pages%2F&amp;source=cootetom&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Have you ever looked at the robots.txt file of a web site? They exist so that web sites can stop search engines and other similar robots from indexing web pages on a web site. However they are often used to hide web pages on live web sites that the web site owners don&#8217;t want people to see. This is a bad way of using robots.txt but never the less it happens a lot. </p>
<p>What this shows for anyone who feels like taking a look is a list of web page paths under a web site that are marked as disallowed. Those lines marked disallowed are like big red buttons with a sign above them saying &#8220;don&#8217;t press the big red button&#8221;. You&#8217;re going to take a look!</p>
<p>So recently <a href="http://more.stevefitzpatrick.co.uk/">Steve</a> asked me to build a quick page that will find the robots.txt file of a web site and automagically create clickable links for all the paths in the file. This makes it really easy to go hunting on web sites for secret pages.</p>
<p>Have a go: <a href="http://robotsneak.com/">robotsneak.com</a></p>
<p>EDIT: Steve and I have now turned the quick page into a fully designed, emotive, masterpiece <img src='http://tomcoote.co.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tomcoote.co.uk/productivity/easy-links-to-disallowed-web-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django South in a team using SVN</title>
		<link>http://tomcoote.co.uk/productivity/django-south-in-a-team-using-svn/</link>
		<comments>http://tomcoote.co.uk/productivity/django-south-in-a-team-using-svn/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 19:57:25 +0000</pubDate>
		<dc:creator>Tom Coote</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tomcoote.co.uk/?p=343</guid>
		<description><![CDATA[
			
				
			
		
South, the schema and data migration tool for django is really useful. I&#8217;ve only started using it myself recently but the benefit is immediate. South creates python files which hold all the information for migrations each time you change the database schema. Each person in a team of developers needs to run these migrations on [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-top:10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Fdjango-south-in-a-team-using-svn%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Fdjango-south-in-a-team-using-svn%2F&amp;source=cootetom&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://south.aeracode.org/" target="_blank">South</a>, the schema and data migration tool for <a href="http://www.djangoproject.com/" target="_blank">django</a> is really useful. I&#8217;ve only started using it myself recently but the benefit is immediate. South creates python files which hold all the information for migrations each time you change the database schema. Each person in a team of developers needs to run these migrations on their development database to keep things up to date and working.</p>
<p>The question is how does one person in a team know that another has changed the schema? If time has passed then simply asking could get a somewhat hazy response.</p>
<p>We use SVN to keep track of code changes amongst the team of developers. SVN is a good place to look to see if migrations were committed. The only thing better than looking in SVN logs for migrations is for SVN to tell us when migrations are committed. So that is what I&#8217;ve had a go at doing.</p>
<p>Using the SVN <a href="http://svnbook.red-bean.com/en/1.0/svn-book.html#svn-ch-5-sect-2.1" target="_blank">pre-commit hook</a> I&#8217;ve been able to send emails to those involved in a project each time someone commits code that contains new database migration changes. The first part of this was to create a pre-commit.bat file in the hooks directory of my projects repository.</p>
<pre class="qoate-code">
C:\python26\python.exe D:\repositories\post_commit_emailer.py %* tom@email.com bob@email.com eddy@email.com
</pre>
<p>This batch file is run by SVN just before a commit happens. It is passed the repository and transaction name when called. As you can see, I&#8217;ve also appended some extra parameters which are the emails of everyone involved with this project.</p>
<p>So the next bit is the python script that this batch file calls.</p>
<pre class="qoate-code">import smtplib
import sys
import pysvn
import re
from datetime import datetime

SERVER = 'localhost'
FROM = 'svn@email.co.uk'
SUBJECT = 'SVN South Migrations Committed'
TEXT = \
'''
The repository location '%s' was committed and included database schema migrations.

Next time you update your working copy for this repository be sure to run the new south migrations on your local database.

The changed files that are thought to be schema migrations are:
   - %s
'''

try:
    # what was committed?
    repo = sys.argv[1]
    txn = sys.argv[2]
    transaction = pysvn.Transaction(repo, txn)
    changes = transaction.changed()

    # look for database migrations that may have been part of this commit
    migrations = []
    for f in changes.keys():
        if re.search(r'migrations/.*\.py$', f):
            migrations.append(f)

    if migrations:
        # prepare the message. Emails to send to are passed as args
        emails = sys.argv[3:]
        message = TEXT % (repo, '\n   - '.join(migrations))
        message = "From: %s\nTo: %s\nSubject: %s\n\n%s" % \
                    (FROM, ', '.join(emails), SUBJECT, message)

        # send the email
        server = smtplib.SMTP(SERVER)
        server.sendmail(FROM, emails, message)
        server.quit()

except Exception as e:
    log = open('C:\\svn_emailer_log.txt', 'a')
    log.write('\n%s : %s' % (datetime.now().isoformat(), str(e)))
    log.close()
</pre>
<p>This script uses <a href="http://pysvn.tigris.org/" target="_blank">pysvn</a> to grab all the changes that are to be committed in this transaction. Once it has that information it looks at the path of each file in the list of changes to find any in a migrations folder. South puts migration files in a folder named migrations. If it finds any then it composes an email to everyone in the parameter list. The email lists the migrations that were committed.</p>
<p>So now everyone involved in a project will get an email if someone commits database schema changes. I&#8217;m going to start using this for our django projects and see how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomcoote.co.uk/productivity/django-south-in-a-team-using-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django using Eclipse IDE and Pydev</title>
		<link>http://tomcoote.co.uk/productivity/django-using-eclipse-ide-and-pydev/</link>
		<comments>http://tomcoote.co.uk/productivity/django-using-eclipse-ide-and-pydev/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 12:38:44 +0000</pubDate>
		<dc:creator>Tom Coote</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://tomcoote.co.uk/?p=283</guid>
		<description><![CDATA[
			
				
			
		
I&#8217;ve been using Wingwares python IDE for Django development for almost 2 years. The Wingware IDE has been very good but I have had a few superficial annoyances with it so decided to look around and see what other IDE&#8217;s I could use. This led me to Eclipse. The first time I had a look [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-top:10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Fdjango-using-eclipse-ide-and-pydev%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Fdjango-using-eclipse-ide-and-pydev%2F&amp;source=cootetom&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been using <a href="http://www.wingware.com/">Wingwares</a> python IDE for Django development for almost 2 years. The Wingware IDE has been very good but I have had a few superficial annoyances with it so decided to look around and see what other IDE&#8217;s I could use. This led me to <a href="http://www.eclipse.org">Eclipse</a>. The first time I had a look around for Django IDE&#8217;s I remember looking at Eclipse but I think I recall difficulties when trying to run Django projects. Eclipse doesn&#8217;t natively support Django, you have to install Pydev to get that. After revisiting Eclipse and Pydev I can safely say I&#8217;ve switched from Wingware to Eclipse for Django development. The Eclipse IDE in itself is very good and full of useful development features. The Pydev plugin for it which allows python and Django development is also fantastic as it has a GUI for creating and managing Django specific python projects. Another great feature of Eclipse is it&#8217;s free price tag where as a single developer license for Wingware is $179 (roughly £115).</p>
<p>To get my Eclipse set up for Django I installed the following:</p>
<ol>
<li><a href="http://www.eclipse.org/downloads/packages/eclipse-classic-360/heliosr">Eclipse Classic 3.6.0</a></li>
<li><a href="http://pydev.org/download.html">Pydev</a></li>
</ol>
<p>Then I read through and followed a few guides to understand Pydev and Django support:</p>
<ol>
<li><a href="http://pydev.org/manual_101_root.html">Pydev getting started guide</a></li>
<li><a href="http://pydev.org/manual_adv_django.html">Pydev Django integration guide</a></li>
</ol>
<p>In less than an hour I was up and running and fully understood how to start and develop Django projects in Eclipse. I&#8217;d even moved 3 existing Django projects into Eclipse in that time.</p>
<p>Sorry Wingware, you&#8217;ve been good to me but I&#8217;m trying Eclipse for a while and I don&#8217;t think I&#8217;m coming back.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomcoote.co.uk/productivity/django-using-eclipse-ide-and-pydev/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sphinx</title>
		<link>http://tomcoote.co.uk/productivity/sphinx/</link>
		<comments>http://tomcoote.co.uk/productivity/sphinx/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 17:22:30 +0000</pubDate>
		<dc:creator>Tom Coote</dc:creator>
				<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://tomcoote.co.uk/?p=173</guid>
		<description><![CDATA[
			
				
			
		
I have been using a tool called Sphinx to help write some documentation recently. Writing documentation is boring, time consuming and rubbish. Sphinx doesn&#8217;t magically make all those problems go away but it is a great tool none the less.

It has a nice fluid syntax which is near to how I&#8217;d normally jot down notes [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-top:10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Fsphinx%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftomcoote.co.uk%2Fproductivity%2Fsphinx%2F&amp;source=cootetom&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I have been using a tool called <a href="http://sphinx.pocoo.org/">Sphinx</a> to help write some documentation recently. Writing documentation is boring, time consuming and rubbish. Sphinx doesn&#8217;t magically make all those problems go away but it is a great tool none the less.</p>
<ul>
<li>It has a nice fluid syntax which is near to how I&#8217;d normally jot down notes in notepad.</li>
<li>It&#8217;s layered so that it separates the actual documentation files from the presentation of those files.</li>
<li>Presentation can be in the form of a complete HTML web site or PDF (amongst others) and this is all done automatically for you.</li>
<li>It allows for theming of the HTML output so you can integrate you&#8217;re documentation directly into your web site.</li>
<li>Creation of contents tables, index pages and search area is all done, no effort required.</li>
</ul>
<p>I&#8217;ve tried writing documentation both in a word document and as a HTML web page. Both methods are a nightmare to manage with infinite page long word documents and the constant need to write all the HTML tags/links for the web page method. I just want to write the words that make my documentation and that&#8217;s what Sphinx lets me do.</p>
<p>Now where can I get a GUI for it?</p>
]]></content:encoded>
			<wfw:commentRss>http://tomcoote.co.uk/productivity/sphinx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

