Richard Jones' Log

Mon, 21 Feb 2011
PyCon Australia 2011 - Call for Participation

The second PyCon AU will be held in Sydney on the weekend of the 20th and 21st of August at the Sydney Masonic Center.

We are looking for proposals for talks on all aspects of Python programming from novice to advanced levels; applications and frameworks, or how you have been involved in introducing Python into your organisation. We're especially interested in short presentations that will teach conference-goers something new and useful. Can you show attendees how to use a module? Explore a Python language feature? Package an application?

We welcome first-time speakers; we are a community conference and we are eager to hear about your experience. If you have friends or colleagues who have something valuable to contribute, twist their arms to tell us about it! Please also forward this Call for Proposals to anyone that you feel may be interested.

To find out more go to the official Call for Proposals page.

The deadline for proposal submission is the 2nd of May.

See you in Sydney in August!

Richard Jones
http://pycon-au.org/
PyCon AU Program Chair
category: Python | permanent link
Tue, 08 Feb 2011
PyCon Australia 2011: 20th & 21st August, Sydney Masonic Center

The second PyCon Australia will be held in Sydney on the weekend of the 20th and 21st of August at the Sydney Masonic Center.

The first PyCon Australia was held in June 2010 and attracted over 200 Python programming enthusiasts. The second event is expected to host over 250 attendees.

The weekend will see dozens of presentations introducing;

  • Python programming and techniques,
  • web programming,
  • business applications,
  • game development,
  • education, science and mathematics,
  • social issues,
  • testing, databases, documentation and more!

We are hoping to organise sprints on the days following the conference proper.

International guests should note that Kiwi PyCon is to run on the following weekend, making it a great opportunity to attend a couple of awesome Down Under conferences and hopefully do some sprinting with the locals.

Richard Jones
http://pycon-au.org/
PyCon AU Committee
category: Python | permanent link
PyWeek 12 (April 2011) is coming!

The 12th Python Game Programming Challenge (PyWeek) is coming. It'll run from the 3rd to the 10th of April.

The PyWeek challenge:

  1. Invites entrants to write a game in one week from scratch either as an individual or in a team,
  2. Is intended to be challenging and fun,
  3. Will hopefully increase the public body of game tools, code and expertise,
  4. Will let a lot of people actually finish a game, and
  5. May inspire new projects (with ready made teams!)

If you've never written a game before and would like to try things out then perhaps you could try either:

  1. The tutorial I presented at LCA 2010, Introduction to Game Programming, or
  2. The book Invent Your Own Computer Games With Python
category: Python | permanent link
Tue, 01 Feb 2011
OS X Mail.app rules to sieve filters

These days I have a snazzy phone with an awesome IMAP client. A problem I have though is the large volume of email my work address gets. I have had my laptop Mail.app rules sorting those messages to sensible folders, but that approach is flawed when my laptop isn't active. I've moved to using sieve on the IMAP server and to do that I wrote the following simple script to convert my Mail.app rules to sieve commands. I didn't even realise the standard library had a plist module until I googled it :-)

import plistlib

p = plistlib.readPlist('/Users/sekrit/Library/Mail/MessageRules.plist')

print '''
require ["fileinto", "reject"];
'''
stmt = 'if'
def handle(header, expression, mbox):
    global stmt
    if header in ('To', 'Cc', 'From'):
        print stmt, 'address :contains ["%s"]  "%s" { fileinto "INBOX.%s"; }' % (header, expression, mbox)
    elif header == 'Subject':
        print stmt, 'header :matches "Subject" ["*%s*"] { fileinto "INBOX.%s"; }' % (expression, mbox)
    else:
        raise ValueError(header)
    stmt = 'elsif'

for rule in p['rules']:
    if 'Mailbox' not in rule: continue
    mbox = rule['Mailbox'].split('/')[-1].split('.')[0]
    print '#', rule['RuleName'], '->', mbox
    for criteria in rule['Criteria']:
        if criteria['Header'] == 'AnyRecipient':
            handle('To', criteria['Expression'], mbox)
            handle('Cc', criteria['Expression'], mbox)
        else:
            handle(criteria['Header'], criteria['Expression'], mbox)

print '''
else {
     keep;
}
'''

ps. I realise my sieve-fu is probably really quite poor :-)

category: Python | permanent link