|
@ -7,17 +7,26 @@ from flask_socketio import SocketIO |
|
|
####################### |
|
|
####################### |
|
|
#### Configuration #### |
|
|
#### Configuration #### |
|
|
#https://www.patricksoftwareblog.com/structuring-a-flask-project/ |
|
|
#https://www.patricksoftwareblog.com/structuring-a-flask-project/ |
|
|
|
|
|
|
|
|
####################### |
|
|
####################### |
|
|
|
|
|
|
|
|
|
|
|
platform = None |
|
|
|
|
|
try: |
|
|
|
|
|
import RPi.GPIO as gpio |
|
|
|
|
|
platform = 'raspberry' |
|
|
|
|
|
except (ImportError, RuntimeError): |
|
|
|
|
|
platform = 'generic' |
|
|
|
|
|
|
|
|
# Create the instances of the Flask extensions (flask-sqlalchemy, flask-login, etc.) in |
|
|
# Create the instances of the Flask extensions (flask-sqlalchemy, flask-login, etc.) in |
|
|
# the global scope, but without any arguments passed in. These instances are not attached |
|
|
# the global scope, but without any arguments passed in. These instances are not attached |
|
|
# to the application at this point. |
|
|
# to the application at this point. |
|
|
login = LoginManager() |
|
|
login = LoginManager() |
|
|
login.login_view = "users.login" |
|
|
login.login_view = "users.login" |
|
|
socketio = SocketIO() |
|
|
socketio = SocketIO() |
|
|
#from roberto.camera.camera_opencv import Camera |
|
|
if platform == 'raspberry': |
|
|
#camera = Camera() |
|
|
from roberto.camera.camera_pi import Camera |
|
|
|
|
|
else: |
|
|
|
|
|
from roberto.camera.camera_opencv import Camera |
|
|
|
|
|
camera = Camera() |
|
|
from roberto.camera.camera_gstreamer_webrtc import WebRTCCamera |
|
|
from roberto.camera.camera_gstreamer_webrtc import WebRTCCamera |
|
|
webrtccamera = WebRTCCamera() |
|
|
webrtccamera = WebRTCCamera() |
|
|
from roberto.Serial import Serial |
|
|
from roberto.Serial import Serial |
|
|