Prepare for v1.0.0 release
This commit is contained in:
parent
431ab3b2e1
commit
0edacbe037
3 changed files with 20 additions and 7 deletions
10
setup.cfg
Normal file
10
setup.cfg
Normal file
|
@ -0,0 +1,10 @@
|
|||
[bumpversion]
|
||||
current_version = 1.0.0
|
||||
commit = False
|
||||
tag = True
|
||||
|
||||
[flake8]
|
||||
show-source = True
|
||||
max-line-length = 120
|
||||
|
||||
[bumpversion:file:snappass/__init__.py]
|
|
@ -1 +1,2 @@
|
|||
__author__ = 'davedash'
|
||||
__version__ = 1.0.0
|
||||
|
|
|
@ -9,9 +9,12 @@ from redis.exceptions import ConnectionError
|
|||
from flask import abort, Flask, render_template, request
|
||||
|
||||
|
||||
SNEAKY_USER_AGENTS = ('Slackbot', 'facebookexternalhit', 'Twitterbot', 'Facebot', 'WhatsApp', 'SkypeUriPreview')
|
||||
SNEAKY_USER_AGENTS = ('Slackbot', 'facebookexternalhit', 'Twitterbot',
|
||||
'Facebot', 'WhatsApp', 'SkypeUriPreview')
|
||||
SNEAKY_USER_AGENTS_RE = re.compile('|'.join(SNEAKY_USER_AGENTS))
|
||||
NO_SSL = os.environ.get('NO_SSL', False)
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
if os.environ.get('DEBUG'):
|
||||
app.debug = True
|
||||
|
@ -28,11 +31,7 @@ else:
|
|||
redis_client = redis.StrictRedis(
|
||||
host=redis_host, port=redis_port, db=redis_db)
|
||||
|
||||
time_conversion = {
|
||||
'week': 604800,
|
||||
'day': 86400,
|
||||
'hour': 3600
|
||||
}
|
||||
time_conversion = {'week': 604800, 'day': 86400, 'hour': 3600}
|
||||
|
||||
|
||||
def check_redis_alive(fn):
|
||||
|
@ -65,10 +64,12 @@ def get_password(key):
|
|||
redis_client.delete(key)
|
||||
return password
|
||||
|
||||
|
||||
def empty(value):
|
||||
if not value:
|
||||
return True
|
||||
|
||||
|
||||
def clean_input():
|
||||
"""
|
||||
Make sure we're not getting bad data from the front end,
|
||||
|
@ -86,6 +87,7 @@ def clean_input():
|
|||
|
||||
return time_conversion[time_period], request.form['password']
|
||||
|
||||
|
||||
def request_is_valid(request):
|
||||
"""
|
||||
Ensure the request validates the following:
|
||||
|
|
Loading…
Reference in a new issue