blob: 1768416b40aa44f6becb065fd3b6a95735720a71 (
plain)
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
|
'''
A shared class among all modules to all
have the same core identifying features
when interacted with.
Verified: 2021 February 7
* Follows PEP8
* Tested Platforms
* Windows 10
'''
from server.helper import SafeIP
from server.state import Dynamic
from shared.error import Error
class Module:
def __init__(self, conn, token, connect_ip):
Dynamic.MODULES[token] = self
self.__conn = conn
self.__token = token
self.__connect_ip = SafeIP(connect_ip)
def __str__(self):
return type(self).__name__
@property
def safe_connect_ip(self):
return self.__connect_ip.safe
@property
def connect_ip(self):
return self.__connect_ip.pure
@property
def token(self):
return self.__token
@property
def conn(self):
return self.__conn
@Error.quiet
def close(self):
self.__conn.close()
|