-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity_ga.py
More file actions
55 lines (40 loc) · 1.05 KB
/
security_ga.py
File metadata and controls
55 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import gc
import os
import threading
import warnings
from os.path import dirname, join
from typing import Optional
from dotenv import load_dotenv
import golden_eagle as ga
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
warnings.simplefilter('ignore', DeprecationWarning)
load_dotenv(verbose=True)
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
INC = os.environ.get("int_conn") or ""
ICL = os.environ.get("int_clock") or ""
# face class
class Face(threading.Thread):
# use thread
def __init__(self):
threading.Thread.__init__(self)
# run method
def run(self):
# golden-eagle version.
print("golden-eagle_version: " + ga.__version__)
inc: Optional[str] = INC
icl: Optional[str] = ICL
# home_security.
ga.security(int(inc), int(icl))
# try ~ except ~ finally.
try:
thread = Face()
thread.run()
# Custom Exception, raise throw.
except ValueError as ext:
print(ext)
raise RuntimeError from None
# Once Exec.
finally:
# GC collection.
gc.collect()