Fixes from 'make pep8'. Partial, more to come.

pull/4420/head
Michael DeHaan 2013-02-17 19:40:38 -05:00
parent 23a0a8daf9
commit 9cf66f4376
4 changed files with 36 additions and 33 deletions

View File

@ -51,7 +51,6 @@ multiprocessing_runner = None
################################################
def _executor_hook(job_queue, result_queue):
# attempt workaround of https://github.com/newsapps/beeswithmachineguns/issues/17

View File

@ -259,11 +259,13 @@ class _jinja2_vars(object):
here.
extras is a list of locals to also search for variables.
'''
def __init__(self, basedir, vars, globals, *extras):
self.basedir = basedir
self.vars = vars
self.globals = globals
self.extras = extras
def __contains__(self, k):
if k in self.vars:
return True
@ -273,6 +275,7 @@ class _jinja2_vars(object):
if k in self.globals:
return True
return False
def __getitem__(self, varname):
if varname not in self.vars:
for i in self.extras:
@ -288,6 +291,7 @@ class _jinja2_vars(object):
return var
else:
return template(self.basedir, var, self.vars)
def add_locals(self, locals):
'''
If locals are provided, create a copy of self containing those