示例#1
0
    def getVimhdlInfo(self):
        """
        Gets info about the current project and hdlcc server
        """
        project_file = vim_helpers.getProjectFile()
        request = RequestHdlccInfo(host=self._host,
                                   port=self._port,
                                   project_file=project_file)

        response = request.sendRequest()

        if response is not None:
            # The server has responded something, so just print it
            self._logger.info("Response: %s", str(response.json()['info']))

            return "\n".join([
                "- %s" % x
                for x in ["vimhdl version: %s\n" % vimhdl.__version__] +
                response.json()['info']
            ])
        else:
            return "\n".join([
                "- %s" % x for x in [
                    "vimhdl version: %s\n" %
                    vimhdl.__version__, "hdlcc server is not running"
                ]
            ])
示例#2
0
    def getVimhdlInfo(self):
        "Gets info about the current project and hdlcc server"
        project_file = vim_helpers.getProjectFile()
        request = RequestHdlccInfo(host=self._host, port=self._port,
                                   project_file=project_file)

        response = request.sendRequest()

        if response is None:
            return "hdlcc server is not running"

        return "\n".join(["vimhdl version: " + vimhdl.__version__] +
                         ["%s: %s" % (k, v)
                          for k, v in response.json().items()])
示例#3
0
    def _waitForServerSetup(self):
        "Wait for ~10s until the server is actually responding"
        for _ in range(10):
            time.sleep(0.1)
            request = RequestHdlccInfo(self._host, self._port)
            reply = request.sendRequest()
            self._logger.debug(reply)
            if reply:
                self._logger.info("Ok, server is really up")
                return
            else:
                self._logger.info("Server is not responding yet")

        self._postError("Unable to talk to server")
示例#4
0
    def _waitForServerSetup(self):
        """
        Wait for ~10s until the server is actually responding
        """
        for _ in range(10):
            time.sleep(0.2)
            request = RequestHdlccInfo()
            response = request.sendRequest()
            self._logger.debug(response)
            if response:
                self._logger.info("Ok, server is really up")
                return
            self._logger.info("Server is not responding yet")

        self._postError("Unable to talk to server")
示例#5
0
    def getVimhdlInfo(self):
        """
        Gets info about the current project and hdlcc server
        """
        project_file = vim_helpers.getProjectFile()
        request = RequestHdlccInfo(host=self._host, port=self._port,
                                   project_file=project_file)

        response = request.sendRequest()

        if response is not None:
            # The server has responded something, so just print it
            self._logger.info("Response: %s", str(response.json()['info']))

            return "\n".join(
                ["- %s" % x for x in
                 ["vimhdl version: %s\n" % vimhdl.__version__] +
                 response.json()['info']])
        else:
            return "\n".join(
                ["- %s" % x for x in
                 ["vimhdl version: %s\n" % vimhdl.__version__,
                  "hdlcc server is not running"]])