Format project

This commit is contained in:
richard-dds
2018-08-23 16:25:36 -04:00
parent e9fa4d9ecb
commit daa8634cb4
48 changed files with 415 additions and 282 deletions

View File

@@ -1,7 +1,8 @@
import re
def iconSvg(name):
with open('static/icons/'+name+'.svg') as contents:
with open("static/icons/" + name + ".svg") as contents:
return contents.read()
@@ -14,8 +15,8 @@ def dollars(value):
def usPhone(number):
phone = re.sub(r'\D', '', number)
return '+1 ({}) {} - {}'.format(phone[0:3], phone[3:6], phone[6:])
phone = re.sub(r"\D", "", number)
return "+1 ({}) {} - {}".format(phone[0:3], phone[3:6], phone[6:])
def readableInteger(value):
@@ -31,9 +32,8 @@ def getOptionLabel(value, options):
def register_filters(app):
app.jinja_env.filters['iconSvg'] = iconSvg
app.jinja_env.filters['dollars'] = dollars
app.jinja_env.filters['usPhone'] = usPhone
app.jinja_env.filters['readableInteger'] = readableInteger
app.jinja_env.filters['getOptionLabel'] = getOptionLabel
app.jinja_env.filters["iconSvg"] = iconSvg
app.jinja_env.filters["dollars"] = dollars
app.jinja_env.filters["usPhone"] = usPhone
app.jinja_env.filters["readableInteger"] = readableInteger
app.jinja_env.filters["getOptionLabel"] = getOptionLabel