-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipe.py
More file actions
37 lines (31 loc) · 631 Bytes
/
pipe.py
File metadata and controls
37 lines (31 loc) · 631 Bytes
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
# Pipe Module for ULTRA
import namedPipe
import constants
import globalVars
server = None
def startServer():
global server
server = namedPipe.Server(constants.PIPE_NAME)
server.setReceiveCallback(onReceived)
server.start()
def onReceived(message):
try:
globalVars.app.hMainView.events.show()
except:
pass
def stopServer():
global server
if server == None:
return
server.exit()
server.close()
server = None
def sendPipe():
client = namedPipe.Client(constants.PIPE_NAME)
while True:
try:
client.connect()
client.write(constants.APP_NAME)
return
except namedPipe.PipeServerNotFoundError:
pass