Addded README

Code cleanup
This commit is contained in:
Matias Fernandez
2019-09-11 22:00:39 -03:00
parent a6327060f9
commit aad1e08f6a
11 changed files with 476 additions and 216 deletions

30
lib/clipboardctrl.py Normal file
View File

@@ -0,0 +1,30 @@
from struct import *
class ClipboardController():
def __init__(self):
pass
def client_cut_text(self, sock):
"""
The client has new ISO 8859-1 (Latin-1) text in its cut buffer.
Ends of lines are represented by the linefeed / newline character (value 10) alone. No carriage-return (value 13) is needed.
No. of bytes Type [Value] Description
1 U8 6 message-type
3 padding
4 U32 length
length U8 array text
"""
# read padding
_ = sock.recv(3)
# read length
length = sock.recv(4)
(length, ) = unpack('!I', length)
# read text
text = sock.recv(length)
return text