-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.py
56 lines (47 loc) · 1.49 KB
/
events.py
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
56
__author__ = "Alon & K9"
from enum import Enum
class Events(Enum):
Screenshot_Request = "SSRQ"
FileContent_Request = "FLRQ"
FileList_Request = "LSRQ"
CopyFile_Request = "CPRQ"
MoveFile_Request = "MVRQ"
RemoveFile_Request = "RMRQ"
ScreenControl_Request = "SCRQ"
ScreenWatch_Request = "SWRQ"
CommandRun_Request = "CMDR"
ScreenControlInput_Action = "SCIN"
ScreenControlDisconnect_Action = "DNSC"
ScreenWatchDisconnect_Action = "DNSW"
FileUpload_Action = "UPCK"
ScreenFrame_Action = "SCFR"
ScreenshotDone_Response = "SDON"
FileDownload_Response = "DNCK"
FileList_Response = "FOLL"
AcceptScreenControl_Response = "ACSC"
AcceptScreenWatch_Response = "ACSW"
CommandRun_Response = "CMDO"
PublicKeyTransfer = "PUKT"
SecretKeyTransfer = "SECT"
OperationSuccess_Response = "SUCC"
OperationFailed_Response = "ERRR"
ConnectionClosed = "CLOS"
UnknownEvent = "UNKNOWN_EVENT"
@classmethod
def from_value(cls, value: str) -> 'Events':
for event in cls:
if value == event.value:
return event
return cls.UnknownEvent
class Error(Enum):
UnknownError = 0
FileNotFound = 1
BadPath = 2
FailureToSendKey = 3
NoVerifyKey = 4
@classmethod
def from_value(cls, value: int) -> 'Error':
for event in cls:
if value == event.value:
return event
return cls.UnknownError