• 大小: 98.29MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2022-07-31
  • 语言: 其他
  • 标签: git  命令行  

资源简介

Cmder是一款Windows环境下非常简洁美观易用的cmd替代者,它是一个跨平台的命令行增强工具,可以集成windows batch, power shell, git, linux bash等多种命令行于一体,支持了大部分的Linux命令。十分方便。还可以通过自定义,让它更方便。

资源截图

代码片段和文件信息

#!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Run this server and then in Vim you can open the channel:
#  :let handle = ch_open(‘localhost:8765‘)
#
# Then Vim can send requests to the server:
#  :let response = ch_sendexpr(handle ‘hello!‘)
#
# And you can control Vim by typing a JSON message here e.g.:
#   [“ex““echo ‘hi there‘“]
#
# There is no prompt just type a line and press Enter.
# To exit cleanly type “quit“.
#
# See “:help channel-demo“ in Vim.
#
# This requires Python 2.6 or later.

from __future__ import print_function
import json
import socket
import sys
import threading

try:
    # Python 3
    import socketserver
except ImportError:
    # Python 2
    import SocketServer as socketserver

thesocket = None

class ThreadedTCPRequestHandler(socketserver.baseRequestHandler):

    def handle(self):
        print(“=== socket opened ===“)
        global thesocket
        thesocket = self.request
        while True:
            try:
                data = self.request.recv(4096).decode(‘utf-8‘)
            except socket.error:
                print(“=== socket error ===“)
                break
            except IOError:
                print(“=== socket closed ===“)
                break
            if data == ‘‘:
                print(“=== socket closed ===“)
                break
            print(“received: {0}“.format(data))
            try:
                decoded = json.loads(data)
            except ValueError:
                print(“json decoding failed“)
                decoded = [-1 ‘‘]

            # Send a response if the sequence number is positive.
            # Negative numbers are used for “eval“ responses.
            if decoded[0] >= 0:
                if decoded[1] == ‘hello!‘:
                    response = “got it“
                else:
                    response = “what?“
                encoded = json.dumps([decoded[0] response])
                print(“sending {0}“.format(encoded))
                self.request.sendall(encoded.encode(‘utf-8‘))
        thesocket = None

class ThreadedTCPServer(socketserver.ThreadingMixIn socketserver.TCPServer):
    pass

if __name__ == “__main__“:
    HOST PORT = “localhost“ 8765

    server = ThreadedTCPServer((HOST PORT) ThreadedTCPRequestHandler)
    ip port = server.server_address

    # Start a thread with the server -- that thread will then start one
    # more thread for each request
    server_thread = threading.Thread(target=server.serve_forever)

    # Exit the server thread when the main thread terminates
    server_thread.daemon = True
    server_thread.start()
    print(“Server loop running in thread: “ server_thread.name)

    print(“Listening on port {0}“.format(PORT))
    while True:
        typed = sys.stdin.readline()
        if “quit“ in typed:
            print(“Goodbye!“)
            break
        if thesocket is None:
            print(“No socket yet“)
        else:
            print(“sending {0}“.format(type

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件           0  2018-10-17 22:40  redeme.txt
     目录           0  2017-07-25 05:15  bin\
     文件        3635  2017-07-25 05:15  bin\alias.bat
     文件          87  2015-10-12 19:00  bin\Readme.md
     文件       74195  2016-12-02 08:00  CHANGELOG.md
     文件      129024  2017-10-28 19:45  Cmder.exe
     目录           0  2017-10-28 20:42  config\
     文件       53667  2017-10-28 20:42  config\ConEmu.xml
     文件         808  2017-04-07 08:36  config\Readme.md
     文件        1822  2015-10-12 19:00  CONTRIBUTING.md
     目录           0  2016-07-14 13:58  icons\
     文件       18089  2015-10-12 19:00  icons\cmder.ico
     文件        5272  2016-07-14 13:58  icons\cmder_blue.ico
     文件        5193  2016-07-14 13:58  icons\cmder_green.ico
     文件        5383  2016-07-14 13:58  icons\cmder_orange.ico
     文件        5317  2016-07-14 13:58  icons\cmder_purple.ico
     文件        4898  2016-07-14 13:58  icons\cmder_red.ico
     文件        5227  2016-07-14 13:58  icons\cmder_yellow.ico
     文件        1090  2017-10-28 20:42  LICENSE
     文件       11653  2017-10-28 20:42  README.md
     目录           0  2017-11-03 20:17  vendor\
     目录           0  2017-11-03 20:17  vendor\clink\
     目录           0  2017-11-03 20:17  vendor\clink-completions\
     文件         595  2017-10-25 02:52  vendor\clink-completions\.appveyor.yml
     文件         116  2017-10-25 02:52  vendor\clink-completions\.busted
     文件          16  2017-11-03 20:17  vendor\clink-completions\.cmderver
     文件          89  2017-10-25 02:52  vendor\clink-completions\.gitignore
     文件         195  2017-10-25 02:52  vendor\clink-completions\.init.lua
     文件         173  2017-10-25 02:52  vendor\clink-completions\.luacheckrc
     文件         133  2017-10-25 02:52  vendor\clink-completions\.luacov
     目录           0  2017-10-25 02:52  vendor\clink-completions\.vscode\
............此处省略6550个文件信息

评论

共有 条评论