Skip to content

Instantly share code, notes, and snippets.

@douglatornell
douglatornell / incremental.py
Created March 18, 2012 17:40
Options for keys list for buildbot try job parser
# Incremental:
v1_keys = ['jobid', 'branch', 'baserev', 'patch_level', 'patch_body']
v2_keys = v1_keys + ['repository', 'project']
v3_keys = v2_keys + ['who']
v4_keys = v3_keys + ['comment']
keys = [v1_keys, v2_keys, v3_keys, v4_keys]
@douglatornell
douglatornell / gist:2728814
Created May 19, 2012 03:09
Typical Traceback of Blogofile plugins Branch Test Error (unittest discover)
With Python 3.2 unittest discover as test runner:
======================================================================
ERROR: testUpperCaseAutoPermalink (blogofile.tests.test_content.TestContent)
Auto generated permalinks should have title and filenames lower case
----------------------------------------------------------------------
Traceback (most recent call last):
File "blogofile/tests/test_content.py", line 79, in testUpperCaseAutoPermalink
main.main("init blog_unit_test")
File "blogofile/main.py", line 186, in main
@douglatornell
douglatornell / gist:2728853
Created May 19, 2012 03:22
Typical Traceback of Blogofile plugins Branch Test Error (py.test)
With Python 3.2 py.test as test runner:
___________________________ TestContent.testUpperCaseAutoPermalink ___________________________
self = <blogofile.tests.test_content.TestContent testMethod=testUpperCaseAutoPermalink>
def testUpperCaseAutoPermalink(self):
"""Auto generated permalinks should have title and filenames lower case
(but not the rest of the URL)"""
main.main("init blog_unit_test")
@douglatornell
douglatornell / gist:4435214
Created January 2, 2013 15:07
pyramid_mailer transaction traceback from Python 3.3
Traceback (most recent call last):
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.3-py3.3.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
result = handler(request)
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 82, in tm_tween
reraise(*exc_info)
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/compat.py", line 13, in reraise
raise value
File "/Users/doug/.virtualenvs/randopony-tetra/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 63, in tm_tween
@douglatornell
douglatornell / dynmodes.ipynb
Created April 29, 2013 04:00
Calculation of Vertical Dynamic Ocean Modes Based on http://woodshole.er.usgs.gov/operations/sea-mat/klinck-html/dynmodes.html by John Klinck, 1999.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglatornell
douglatornell / gist:5730819
Created June 7, 2013 17:13
Scons build file example for Sphinx HTML generation and rsync deployment
# -*- coding: utf-8 -*-
"""SCons build file for dwgLINQ CADD drawing metadata database tool project
for Nordion Vancouver.
"""
import os
env = Environment(
ENV=os.environ,
tools=['sphinx'],
@douglatornell
douglatornell / pages.py
Created June 21, 2013 22:35
Examples of Selenium/WebDriver page objects and tests. The page objects are based on the holmium.core library.
# -*- coding: utf-8 -*-
"""Page objects for UI testing of Nordion SmartSolve CF app.
"""
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from holmium.core import (
Locators,
PageElement,
PageObject,
)
@douglatornell
douglatornell / gist:5887821
Created June 28, 2013 20:26
dwgLINQ search code
@staticmethod
def search(params):
"""Return an iterator that yields :class:`Drawing` objects populated
with the data for the drawings that match the search parameters.
:arg params: Search parameters in key-value pairs from search form
on drawings page.
:type params: dict
"""
filters = []
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.