Initial support for sync
This commit is contained in:
parent
b3d3c26fb8
commit
64f1d647a3
4 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import fl0w
|
import fl0w
|
||||||
from ESock import ESock
|
from ESock import ESock
|
||||||
|
from Sync import SyncClient
|
||||||
import Routing
|
import Routing
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
@ -41,11 +42,14 @@ class WallabyClient:
|
||||||
self.sock = ESock(socket.create_connection(host_port_pair), debug=debug)
|
self.sock = ESock(socket.create_connection(host_port_pair), debug=debug)
|
||||||
self.connected = True
|
self.connected = True
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
self.routes = {"wallaby_control" : WallabyControl()}
|
self.sync = SyncClient(self.sock, "wallaby_testing", "w_sync")
|
||||||
|
self.routes = {"wallaby_control" : WallabyControl(), "w_sync" : self.sync}
|
||||||
|
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
print(os.curdir)
|
||||||
self.sock.send("w", "set_type")
|
self.sock.send("w", "set_type")
|
||||||
|
self.sync.start()
|
||||||
while 1 and self.connected:
|
while 1 and self.connected:
|
||||||
try:
|
try:
|
||||||
data = self.sock.recv()
|
data = self.sock.recv()
|
||||||
|
@ -58,7 +62,7 @@ class WallabyClient:
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.sock.close()
|
self.sock.close()
|
||||||
|
|
||||||
wallaby_client = WallabyClient(("127.0.0.1", 3077))
|
wallaby_client = WallabyClient(("127.0.0.1", 3077), debug=True)
|
||||||
try:
|
try:
|
||||||
wallaby_client.start()
|
wallaby_client.start()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
0
wallaby_testing/lol.txt
Normal file
0
wallaby_testing/lol.txt
Normal file
0
wallaby_testing/test.txt
Normal file
0
wallaby_testing/test.txt
Normal file
0
wallaby_testing/test/lol.txt
Normal file
0
wallaby_testing/test/lol.txt
Normal file
Reference in a new issue