Skip to content

Instantly share code, notes, and snippets.

View steinitzu's full-sized avatar

Steinthor Palsson steinitzu

  • Toronto, ON, Canada
View GitHub Profile
@steinitzu
steinitzu / ttapi
Last active August 29, 2015 14:06
import codecs
import operator
from urllib import urlencode, quote
from cookielib import CookieJar
from urllib2 import build_opener, HTTPCookieProcessor
import logging
from HTMLParser import HTMLParser
from bs4 import BeautifulSoup
DROP TABLE attributes;
CREATE TABLE attributes(
key VARCHAR,
value VARCHAR,
entity_id INTEGER);
INSERT INTO attributes(key,value,entity_id) values ('j','raugaj',1);
INSERT INTO attributes(key,value,entity_id) values ('n','lion',7);
INSERT INTO attributes(key,value,entity_id) values ('f','wolf',19);
INSERT INTO attributes(key,value,entity_id) values ('c','fennec',233);
"""
Improved prune_dirs for humblebee and beets.
Supports glob patterns for clutter.
"""
import os
import shutil
import fnmatch
def fnmatches(names, patterns):
class Resource(object):
def get_script(self, *args):
if not args:
raise error.InvalidArgumentError('get_script requires a path')
scriptf = os.path.join(self.static_dir, os.sep.join(*args))
return open(scriptf).read()
def index(self):
indexfile = os.path.join(self.static_dir, 'index.html')