Flake8 fixes
This commit is contained in:
parent
e46f1e9dff
commit
8d366bb80c
2 changed files with 7 additions and 4 deletions
|
@ -26,9 +26,9 @@ DEFAULT_CONF = {
|
|||
|
||||
def db_connect(db_url):
|
||||
engine = create_engine(db_url)
|
||||
Session = sessionmaker(bind=engine)
|
||||
session = sessionmaker(bind=engine)
|
||||
|
||||
return (engine, Session)
|
||||
return (engine, session)
|
||||
|
||||
|
||||
def int_interval(s):
|
||||
|
|
|
@ -27,11 +27,14 @@ REPO_API_URL_RE = re.compile(r'^.*/repositories\?since=(\d+)')
|
|||
|
||||
|
||||
def save_http_response(r, cache_dir):
|
||||
escape_url_path = lambda p: p.replace('/', '__')
|
||||
def escape_url_path(p):
|
||||
return p.replace('/', '__')
|
||||
|
||||
fname = os.path.join(cache_dir,
|
||||
escape_url_path(r.request.path_url) + '.gz')
|
||||
with gzip.open(fname, 'w') as f:
|
||||
emit = lambda s: f.write(bytes(s, 'UTF-8'))
|
||||
def emit(s):
|
||||
f.write(bytes(s, 'UTF-8'))
|
||||
emit(pformat(r.request.path_url))
|
||||
emit('\n#\n')
|
||||
emit(pformat(r.status_code))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue