forked from tpd94/CDRM-Project
		
	Refactor main module to improve structure and add module docstring
This commit is contained in:
		
							parent
							
								
									e66e32ef0a
								
							
						
					
					
						commit
						1ef842978a
					
				
							
								
								
									
										21
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								main.py
									
									
									
									
									
								
							@ -1,11 +1,10 @@
 | 
			
		||||
from custom_functions.prechecks.python_checks import run_python_checks
 | 
			
		||||
"""Main module to run the application."""
 | 
			
		||||
 | 
			
		||||
run_python_checks()
 | 
			
		||||
from custom_functions.prechecks.precheck import run_precheck
 | 
			
		||||
 | 
			
		||||
run_precheck()
 | 
			
		||||
import os
 | 
			
		||||
import yaml
 | 
			
		||||
from flask import Flask
 | 
			
		||||
from flask_cors import CORS
 | 
			
		||||
 | 
			
		||||
from routes.react import react_bp
 | 
			
		||||
from routes.api import api_bp
 | 
			
		||||
from routes.remote_device_wv import remotecdm_wv_bp
 | 
			
		||||
@ -15,11 +14,17 @@ from routes.user_info import user_info_bp
 | 
			
		||||
from routes.register import register_bp
 | 
			
		||||
from routes.login import login_bp
 | 
			
		||||
from routes.user_changes import user_change_bp
 | 
			
		||||
import os
 | 
			
		||||
import yaml
 | 
			
		||||
from custom_functions.prechecks.python_checks import run_python_checks
 | 
			
		||||
from custom_functions.prechecks.precheck import run_precheck
 | 
			
		||||
 | 
			
		||||
run_python_checks()
 | 
			
		||||
run_precheck()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
app = Flask(__name__)
 | 
			
		||||
with open(f"{os.getcwd()}/configs/config.yaml", "r") as file:
 | 
			
		||||
with open(
 | 
			
		||||
    os.path.join(os.getcwd(), "configs", "config.yaml"), "r", encoding="utf-8"
 | 
			
		||||
) as file:
 | 
			
		||||
    config = yaml.safe_load(file)
 | 
			
		||||
app.secret_key = config["secret_key_flask"]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user