insert_line.py 595 B

1234567891011121314151617181920212223
  1. #!/usr/bin/python
  2. from gui import *
  3. import time
  4. def send(timest, nick, msg):
  5. node_id = api.lookup_node_id("/window/view/chatty")
  6. arg_data = bytearray()
  7. serial.write_u64(arg_data, timest)
  8. arg_data += bytes(32)
  9. serial.encode_str(arg_data, nick)
  10. serial.encode_str(arg_data, msg)
  11. api.call_method(node_id, "insert_line", arg_data)
  12. #for i in range(28):
  13. #for i in range(27):
  14. # send(1722944640000 + i, "hhi12", "hello 123")
  15. # time.sleep(0.1)
  16. #time.sleep(0.5)
  17. #send(1722944641015, "john", "hpqjyzzxxdhio")
  18. #time.sleep(1)
  19. send(1722944642015, "clr", "hello1234ppjjh")