12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2022/10/30 19:18:53
- @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
- @Desc :
- 实现逻辑:
- pc1: 启动sharemouse, 启动server,启动client去search是否有server
- pc2: 启动sharemouse,同理,成功发现server1,
- '''
- import os
- import sys
- import re
- import argparse
- from turtle import st
- from sharemouse.server import Server
- from sharemouse.client import Client
- import logging as log
- class ShareMouse(object):
- def __init__(self):
- super().__init__()
- self.parser = argparse.ArgumentParser(
- description="config for sharemouse")
- self.parser.add_argument(
- "--port", type=str, default="6555", help="server port")
- self.parser.add_argument(
- "--username", type=str, default="", help="register and login your account.")
- self.parser.add_argument(
- "--pwd", type=str, default=None, help="The password of connecting to server.")
- self.parser.add_argument("--token", type=str, default="", help="token")
- def run(self):
- # start server
- server = Server(port=self.parser.get_default("port"))
- server.start()
- log.info("-----------start-------")
- # start client and search server
- client = Client()
- client.connect()
- def stop(self):
- pass
- def syncAction(self):
- '''同步操作,鼠标移动,点击,键盘按键'''
- pass
- if __name__ == "__main__":
- ShareMouse().run()
|