Updated setup and routes for pipx compatibility

main
Ben Busby 2020-05-06 18:13:02 -06:00
parent 9ca74397b4
commit d316fd77c6
2 changed files with 17 additions and 2 deletions

View File

@ -1,6 +1,7 @@
from app import app from app import app
from app.filter import Filter from app.filter import Filter
from app.request import Request, gen_query from app.request import Request, gen_query
import argparse
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from cryptography.fernet import Fernet, InvalidToken from cryptography.fernet import Fernet, InvalidToken
from flask import g, make_response, request, redirect, render_template, send_file from flask import g, make_response, request, redirect, render_template, send_file
@ -137,5 +138,14 @@ def window():
return render_template('display.html', response=results) return render_template('display.html', response=results)
if __name__ == '__main__': def run_app():
app.run(debug=True) parser = argparse.ArgumentParser(description='Whoogle Search console runner')
parser.add_argument('--port', default=8888, metavar='<port number>',
help='Specifies a port to run on (default 8888)')
parser.add_argument('--host', default='127.0.0.1', metavar='<ip address>',
help='Specifies the host address to use (default 127.0.0.1)')
parser.add_argument('--debug', default=False, action='store_true',
help='Activates debug mode for the Flask server (default False)')
args = parser.parse_args()
app.run(host=args.host, port=args.port, debug=args.debug)

View File

@ -16,6 +16,11 @@ setuptools.setup(
long_description=long_description, long_description=long_description,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',
url='https://github.com/benbusby/whoogle-search', url='https://github.com/benbusby/whoogle-search',
entry_points={
'console_scripts': [
'whoogle-search=app.routes:run_app',
]
},
packages=setuptools.find_packages(), packages=setuptools.find_packages(),
classifiers=[ classifiers=[
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',