code_map_support.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:sublime-codemap 作者: oleg-shilo 项目源码 文件源码
def send_syntax_request(file, operation):
        try:
            syntaxerPort = int(os.environ.get(
                'CSSCRIPT_SYNTAXER_PORT', 'not_configured'))
            if syntaxerPort == 'not_configured':
                return None

            clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            clientsocket.connect(('localhost', syntaxerPort))
            request = '-client:{0}\n-op:{1}\n-script:{2}'.format(
                os.getpid(), operation, file)
            clientsocket.send(request.encode('utf-8'))
            response = clientsocket.recv(1024 * 5)
            return response.decode('utf-8')
        except socket_error as serr:
            if serr.errno == errno.ECONNREFUSED:
                print(serr)

    # -----------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号