move depenency up

This commit is contained in:
Maxim Stewart 2020-11-22 17:40:18 -06:00
parent 077120e9e4
commit 4a3f7b8384
4 changed files with 14 additions and 19 deletions

View File

@ -4,6 +4,7 @@ from datetime import timedelta
# Lib imports
import pyautogui
import eventlet
from engineio.payload import Payload
@ -23,11 +24,12 @@ from flask_socketio import SocketIO
# Configs and 'init'
APP_NAME = 'RemoteMouse'
ROOT_FILE_PTH = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__)
app.config.update({
"TITLE": 'RemoteMouse',
"TITLE": APP_NAME,
'DEBUG': False,
'SECRET_KEY': secrets.token_hex(32),
'PERMANENT_SESSION_LIFETIME': timedelta(days = 7).total_seconds()
@ -45,4 +47,10 @@ socketio = SocketIO(app, async_mode = 'eventlet',
logger = True)
app.jinja_env.globals['TITLE'] = APP_NAME
pyautogui.FAILSAFE = False # If we hit corner, that's ok
# Let piautogui make updates as quick as it can...
pyautogui.MINIMUM_DURATION = 0
pyautogui.PAUSE = 0
from core import routes

View File

@ -7,24 +7,17 @@ from flask import request, render_template
# App imports
from core import app, socketio # Get from __init__
from core import app, pyautogui, socketio # Get from __init__
from core.MessageHandler import MessageHandler # Get simple message processor
msgHandler = MessageHandler()
TITLE = app.config['TITLE']
pyautogui.FAILSAFE = False # If we hit corner, that's ok
# Let piautogui make updates as quick as it can...
pyautogui.MINIMUM_DURATION = 0
pyautogui.PAUSE = 0
@app.route('/')
def home():
if request.method == 'GET':
return render_template('index.html',
title=TITLE)
return render_template('index.html')
return render_template('error.html',
title='Error!',
@ -42,7 +35,6 @@ def soundManager():
print(process.stdout.read())
_apps = []
return render_template('sound-manager.html',
title=TITLE,
apps=_apps)
return render_template('error.html',

View File

@ -6,7 +6,7 @@ from flask import request, render_template
# App imports
from core import app, socketio # Get from __init__
from core import app, pyautogui, socketio # Get from __init__
from core.MessageHandler import MessageHandler # Get simple message processor
@ -14,11 +14,6 @@ from core.MessageHandler import MessageHandler # Get simple message processor
msgHandler = MessageHandler()
pyautogui.FAILSAFE = False # If we hit corner, that's ok
# Let piautogui make updates as quick as it can...
pyautogui.MINIMUM_DURATION = 0
pyautogui.PAUSE = 0
@app.route('/mouse-down')
@socketio.on('mouse_down')
@ -79,4 +74,4 @@ def updateCoords(message):
# print(str(x) + "," + str(y))
pyautogui.moveRel(x, y);
except Exception as e:
print( repr(e) )
pass

View File

@ -6,7 +6,7 @@
{% if title %}
<title>{{title}}</title>
{% else %}
<title>App</title>
<title>{{TITLE}}</title>
{% endif %}
{% block header_css %}