Fix PEP8 Errors
Change-Id: Ieb831fbb2c27e0b6428227845dfa9b7a7c7fa2bf
This commit is contained in:
parent
cdbc906dc9
commit
154bedd5bd
@ -18,10 +18,10 @@ import yaml
|
||||
|
||||
from jinja2 import FileSystemLoader
|
||||
from jinja2.environment import Environment
|
||||
from docutils import nodes
|
||||
|
||||
PATH_PREFIX = 'candidates'
|
||||
|
||||
|
||||
def build_timer(app):
|
||||
app.add_javascript("event_timer.js")
|
||||
data = yaml.load(open("events.yaml").read())
|
||||
@ -35,7 +35,8 @@ def build_timer(app):
|
||||
loader = FileSystemLoader(template_dir)
|
||||
env = Environment(trim_blocks=True, loader=loader)
|
||||
template = env.get_template("events.jinja")
|
||||
out.write(template.render({'events':data}))
|
||||
out.write(template.render({'events': data}))
|
||||
|
||||
|
||||
def setup(app):
|
||||
if not os.path.isfile("events.yaml"):
|
||||
|
@ -28,7 +28,8 @@ now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc,
|
||||
def check_atc_date(atc):
|
||||
if 'expires-in' not in atc:
|
||||
return False
|
||||
expires_in = datetime.datetime.strptime(atc['expires-in'], '%B %Y').replace(tzinfo=pytz.utc)
|
||||
expires_in = datetime.datetime.strptime(atc['expires-in'], '%B %Y')
|
||||
expires_in = expires_in.replace(tzinfo=pytz.utc)
|
||||
return now < expires_in
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user