Skip to content

Instantly share code, notes, and snippets.

{"style": ["Broken Beat", "Techno", "Tech House"], "extraartists": [{"tracks": "", "role": "Producer, Recorded By", "name": "Alexi Delano"}, {"tracks": "", "role": "Producer, Recorded By", "name": "Cari Lekebusch"}, {"tracks": "", "role": "Written-By", "name": "Alexi Delano", "anv": "A. Delano"}, {"tracks": "", "role": "Written-By", "name": "Cari Lekebusch", "anv": "C. Lekebusch"}], "format": [{"text": "", "desc": ["12\""], "name": "Vinyl", "qty": "1"}], "country": "Sweden", "notes": "All joints recorded in NYC (Dec.97).", "labels": [{"catno": "SK 026", "name": "Svek"}, {"catno": "SK026", "name": "Svek"}], "artists": [{"name": "Mr. James Barth & A.D."}], "released": "1998-06-00", "tracks": [{"duration": "5:08", "pos": "A1", "title": "A Sea Apart"}, {"duration": "4:21", "pos": "A2", "title": "Dutchmaster"}, {"duration": "4:22", "pos": "B1", "title": "Inner City Lullaby"}, {"duration": "4:46", "pos": "B2", "title": "Yeah Kid!"}], "year": "1998", "genre": ["Electronic"], "title": "Knockin' Boots Vol 2 Of 2", "re
from base import BaseTestCase
from tests.lib.actions import HtmlDocument, click_link, click_button, fill_in
from tests.lib.exceptions import LinkNotFound, ButtonNotFound, InputNotFound
from werkzeug.wrappers import Response
class TestLibActions(BaseTestCase):
def test_click_link(self):
self.assertEqual(click_link(response, 'Explore Releases'), '/releases')
self.assertRaises(LinkNotFound, click_link, response, 'wat')
from base import BaseTestCase
from tests.lib.actions import HtmlDocument, click_link
from werkzeug.wrappers import Response
response = Response('''
<html>
<head>
<title>Discogs</title>
</head>
@wesrog
wesrog / .vimrc
Last active December 11, 2015 16:19
set nocompatible
call pathogen#infect('~/src/vim/bundle/{}')
call pathogen#helptags()
syntax on
filetype on
filetype plugin on
filetype indent on
set exrc " enable per-directory .vimrc files
--ignore-dir=dst
--type-set=SQL=.sql
--noSQL
--type-set=CSS=.scss
@wesrog
wesrog / python_indent.py
Created November 7, 2012 00:23
python indentation
# aligned
return str('%s://%s/%s%s' % (
self.url_scheme,
self.get_host(domain_part),
posixpath.join(self.script_name[:-1].lstrip('/'),
url_quote(path_info.lstrip('/'), self.map.charset,
safe='/:|+')),
suffix
))
@wesrog
wesrog / python_idiom_2.py
Created November 6, 2012 23:46
Python idiom 2
# This
item_details = {
'item_id': int('%d%d%d' % (release_id, user['uid'], c)),
'uid': user['uid'],
'cond': cond,
'price': 5.00,
'curr_id': user['seller_curr_id'],
'release_id': release_id,
'post_ts': SYSDATE,
'status': 'For Sale',
@wesrog
wesrog / python_idiom_1.py
Created November 6, 2012 23:38
New favorite Python idiom
# This
def fixture_create_user(*args, **kwargs):
username = kwargs.pop('username', 'test')
seller = kwargs.pop('seller', False)
buyer = kwargs.pop('buyer', False)
voter = kwargs.pop('voter', False)
curr_id = kwargs.pop('curr_id', 1)
banned = kwargs.pop('banned', 'N')
account_closed = kwargs.pop('account_closed', 'N')
auto_activate = kwargs.pop('auto_activate', True)
@wesrog
wesrog / .vimrc
Created August 28, 2012 16:50
vimrc
filetype off
call pathogen#infect('~/src/vim/bundle')
call pathogen#helptags()
filetype plugin indent on
syntax on
set expandtab
set shiftwidth=4
set tabstop=4
call pathogen#infect('~/src/vim/bundle')
syntax on
filetype plugin indent on
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab
set ai "Auto indent