Terarea  2
The automation project
Loading...
Searching...
No Matches
src.lib.server.Server Class Reference
Collaboration diagram for src.lib.server.Server:
Collaboration graph

Public Member Functions

None __init__ (self, str host="0.0.0.0", int port=5000, int success=0, int error=84, str app_name="Area", bool debug=False)
 
None __del__ (self)
 
int main (self)
 
bool is_running (self)
 
None stop_server (self)
 

Data Fields

str host = host
 
int port = port
 
int success = success
 
int error = error
 
bool debug = debug
 
Disp disp
 
RuntimeData runtime_data_initialised
 

Detailed Description

_summary_

Definition at line 16 of file server.py.

Constructor & Destructor Documentation

◆ __init__()

None src.lib.server.Server.__init__ ( self,
str host = "0.0.0.0",
int port = 5000,
int success = 0,
int error = 84,
str app_name = "Area",
bool debug = False )
_summary_
    This is the class Server, a class that contains the structures used to allow the uvicorn and fastapi combo to run successfully.
Args:
    host (str, optional): _description_. Defaults to "0.0.0.0".
    port (int, optional): _description_. Defaults to 5000.
    character_folder (str, optional): _description_. Defaults to "".
    usr_db_path (str, optional): _description_. Defaults to "".
    success (int, optional): _description_. Defaults to 0.
    error (int, optional): _description_. Defaults to 84.
    app_name (str, optional): _description_. Defaults to "Desktop Pets".
    debug (bool, optional): _description_. Defaults to False.

Definition at line 20 of file server.py.

◆ __del__()

None src.lib.server.Server.__del__ ( self)
_summary_
    The destructor of the class.

Definition at line 136 of file server.py.

Member Function Documentation

◆ is_running()

bool src.lib.server.Server.is_running ( self)
_summary_
    The function in charge of checking if the server is running.

Returns:
    bool: _description_: Returns True if the server is running.

Definition at line 169 of file server.py.

◆ main()

int src.lib.server.Server.main ( self)
_summary_
    The main function of the server.
    This is the one in charge of starting the server.

Returns:
    int: _description_

Definition at line 143 of file server.py.

◆ stop_server()

None src.lib.server.Server.stop_server ( self)
_summary_
    The function in charge of stopping the server.

Definition at line 178 of file server.py.

Field Documentation

◆ debug

bool src.lib.server.Server.debug = debug

Definition at line 38 of file server.py.

◆ disp

Disp src.lib.server.Server.disp
Initial value:
= Disp(
TOML_CONF,
FILE_DESCRIPTOR,
SAVE_TO_FILE,
FILE_NAME,
debug=self.debug,
logger=self.__class__.__name__
)

Definition at line 40 of file server.py.

◆ error

int src.lib.server.Server.error = error

Definition at line 37 of file server.py.

◆ host

str src.lib.server.Server.host = host

Definition at line 34 of file server.py.

◆ port

int src.lib.server.Server.port = port

Definition at line 35 of file server.py.

◆ runtime_data_initialised

RuntimeData src.lib.server.Server.runtime_data_initialised
Initial value:
= RuntimeData(
host=self.host,
port=self.port,
app_name=app_name,
error=self.error,
success=self.success
)

Definition at line 49 of file server.py.

◆ success

int src.lib.server.Server.success = success

Definition at line 36 of file server.py.


The documentation for this class was generated from the following file: