Tabs, meet your new overlords: spaces

In a quest to reach pep8, use spaces to indent rather than tabs.
This commit is contained in:
Magnus Hagander
2019-01-17 15:30:25 +01:00
parent b2ed494655
commit 87237f6536
121 changed files with 5331 additions and 5331 deletions

View File

@ -14,27 +14,27 @@ import psycopg2
# Templates that we don't want to ban automatically
BANNED_TEMPLATES=(
'base/base.html',
'base/base.html',
)
if __name__ == "__main__":
config = ConfigParser()
config.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'purgehook.ini'))
conn = psycopg2.connect(config.get('db', 'dsn'))
curs = conn.cursor()
config = ConfigParser()
config.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'purgehook.ini'))
conn = psycopg2.connect(config.get('db', 'dsn'))
curs = conn.cursor()
for l in sys.stdin:
if l.startswith('templates/'):
tmpl = l[len('templates/'):].strip()
if not tmpl in BANNED_TEMPLATES:
curs.execute("SELECT varnish_purge_xkey(%(key)s)", {
'key': 'pgwt_{0}'.format(hashlib.md5(tmpl).hexdigest()),
})
elif l.startswith('media/'):
# For media we can't xkey, but the URL is exact so we can
# use a classic single-url purge.
curs.execute("SELECT varnish_purge('^/' || %(u)s || '$')", {
'u': l.strip(),
})
conn.commit()
conn.close()
for l in sys.stdin:
if l.startswith('templates/'):
tmpl = l[len('templates/'):].strip()
if not tmpl in BANNED_TEMPLATES:
curs.execute("SELECT varnish_purge_xkey(%(key)s)", {
'key': 'pgwt_{0}'.format(hashlib.md5(tmpl).hexdigest()),
})
elif l.startswith('media/'):
# For media we can't xkey, but the URL is exact so we can
# use a classic single-url purge.
curs.execute("SELECT varnish_purge('^/' || %(u)s || '$')", {
'u': l.strip(),
})
conn.commit()
conn.close()