This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
pages = { | |
"start": { | |
"text": "It's a dark night outside. Somewhere a wolf howls.", | |
"prompt": "Where will you take shelter, the haunted house, or the bat " | |
"cave?", | |
"next": ("haunted house", "bat cave"), | |
}, | |
"haunted house": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index(request): | |
if request.method == "GET": | |
return render_to_response('locations/index.html', {'nosearch': True}) | |
elif request.method == "POST": | |
context = {} | |
result = Location.objects.filter(address=request.POST['address']) | |
loc = result.first() | |
context['loc'] = loc | |
context['services'] = _get_services(loc) | |
return render_to_response('locations/services.html', context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "/Users/martin/Projects/md5checker/playground/md5checker/tests.py", line 15, in test_new_md5hash_derived_field | |
self.assertEqual(m.md5, md5) | |
AssertionError: '' != '9a618248b64db62d15b300a07b00580b' | |
+ 9a618248b64db62d15b300a07b00580b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
def get_hosts(tree_root): | |
'''Takes an ETree root | |
For every sin in a given xml_file, return a list containing the FQDN. | |
''' | |
return [server.get('host') for server in tree_root.iter('sin')] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_deploys(self): | |
''' Separate out the deploys from the rest of the tasks section | |
and return them. | |
''' | |
# rdeploys = [step for step in self.tasks['tasks'] if 'rdepoy' in step] | |
return filter(lambda s: 'rdeploy' in s, self.tasks['tasks']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim color file | |
" Converted from sailorhg's original fairyfloss tmtheme (http://sailorhg.github.io/fairyfloss/) | |
" using Coloration v0.4.0 (http://github.com/sickill/coloration) | |
" To use in your vimrc: http://www.mkyong.com/linux/how-to-install-a-vim-color-scheme/ | |
set background=dark | |
highlight clear | |
if exists("syntax_on") | |
syntax reset |