Modifying functions
This commit is contained in:
parent
6074076841
commit
b1c4f64af5
1 changed files with 11 additions and 5 deletions
6
myapp.py
6
myapp.py
|
@ -12,7 +12,10 @@ import urllib.parse
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="To set up database location and intial values by system administrator")
|
parser = argparse.ArgumentParser(description="To set up database location and intial values by system administrator")
|
||||||
parser.add_argument("--setDatabase", type=int, default=0, help="Wether system administrator want to set up database (1) or not (0)")
|
parser.add_argument("--setDatabase", type=int, default=0, help="Wether system administrator want to set up database (1) or not (0)")
|
||||||
|
parser.add_argument("--launch", type=int, default=1, help="Wether to launch the application (1) or not (0)")
|
||||||
set_database = parser.parse_args().setDatabase
|
set_database = parser.parse_args().setDatabase
|
||||||
|
launch_app = parser.parse_args().launch
|
||||||
|
|
||||||
|
|
||||||
app = flask.Flask(import_name=__name__, template_folder=".")
|
app = flask.Flask(import_name=__name__, template_folder=".")
|
||||||
actuator_locker = threading.Lock()
|
actuator_locker = threading.Lock()
|
||||||
|
@ -139,6 +142,8 @@ def database_setter():
|
||||||
passw = str(input("Enter the password: "))
|
passw = str(input("Enter the password: "))
|
||||||
subprocess.run("echo \"INTERNET_PWD='"+passw+"'\" >> "+database_location+"/config.py", shell=True, executable="/bin/bash")
|
subprocess.run("echo \"INTERNET_PWD='"+passw+"'\" >> "+database_location+"/config.py", shell=True, executable="/bin/bash")
|
||||||
|
|
||||||
|
def users_manager(lck):
|
||||||
|
pass
|
||||||
|
|
||||||
def opener(lck):
|
def opener(lck):
|
||||||
with lck:
|
with lck:
|
||||||
|
@ -250,6 +255,7 @@ if __name__=="__main__":
|
||||||
exit(-1)
|
exit(-1)
|
||||||
#---import config file---
|
#---import config file---
|
||||||
import config
|
import config
|
||||||
|
if launch_app==1:
|
||||||
remote_handler_thread = threading.Thread(target=remote_handler, args=(actuator_locker,))
|
remote_handler_thread = threading.Thread(target=remote_handler, args=(actuator_locker,))
|
||||||
remote_handler_thread.start()
|
remote_handler_thread.start()
|
||||||
localtunnel_thread = threading.Thread(target=localtunnel_launcher)
|
localtunnel_thread = threading.Thread(target=localtunnel_launcher)
|
||||||
|
|
Loading…
Reference in a new issue