Fix PEP8 Errors

Change-Id: Ieb831fbb2c27e0b6428227845dfa9b7a7c7fa2bf
This commit is contained in:
Tony Breeds 2016-03-11 13:35:03 +11:00
parent cdbc906dc9
commit 154bedd5bd
2 changed files with 5 additions and 3 deletions

View File

@ -18,10 +18,10 @@ import yaml
from jinja2 import FileSystemLoader from jinja2 import FileSystemLoader
from jinja2.environment import Environment from jinja2.environment import Environment
from docutils import nodes
PATH_PREFIX = 'candidates' PATH_PREFIX = 'candidates'
def build_timer(app): def build_timer(app):
app.add_javascript("event_timer.js") app.add_javascript("event_timer.js")
data = yaml.load(open("events.yaml").read()) data = yaml.load(open("events.yaml").read())
@ -37,6 +37,7 @@ def build_timer(app):
template = env.get_template("events.jinja") template = env.get_template("events.jinja")
out.write(template.render({'events': data})) out.write(template.render({'events': data}))
def setup(app): def setup(app):
if not os.path.isfile("events.yaml"): if not os.path.isfile("events.yaml"):
app.info('No events.yaml found, not loading events_timer extension') app.info('No events.yaml found, not loading events_timer extension')

View File

@ -28,7 +28,8 @@ now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc,
def check_atc_date(atc): def check_atc_date(atc):
if 'expires-in' not in atc: if 'expires-in' not in atc:
return False 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 return now < expires_in