posting
quadrismegistus 4 years ago
parent 7c840b2040
commit ad7d5fb0b7

@ -288,11 +288,15 @@ def test_register():
marxbot.register(passphrase='spectre')
def test_msg():
z = locate_an_operator('zuck')
z = comlink('zuck')
z.login(passphrase='eee')
s = locate_an_operator('sergey')
z.send_msg_to('you ssssssuck',s)
s = comlink('sergey')
z.send_msg_to('you ssssssuck')
if __name__=='__main__':
test_msg()

@ -9,10 +9,11 @@ from komrade.backend import *
def locate_an_operator_somehow(str_or_byte_or_obj):
if issubclass(type(str_or_byte_or_obj),Operator): return str_or_byte_or_obj
if type(str_or_byte_or_obj)==bytes: return locate_an_operator(name=str_or_byte_or_obj)
if type(str_or_byte_or_obj)==str: return locate_an_operator(name=str_or_byte_or_obj)
if type(str_or_byte_or_obj)==bytes: return locate_an_operator(pubkey=str_or_byte_or_obj)
raise KomradeException(type(str_or_byte_or_obj),'???')
def comlink(name_or_pubkey): return locate_an_operator_somehow(x)
PHONEBOOK = {}

Loading…
Cancel
Save