Skip to content

Added new command version. Query the server for client's read-only status. - #57

Open
EricPei20 wants to merge 1 commit into
mainfrom
client-read-only
Open

Added new command version. Query the server for client's read-only status.#57
EricPei20 wants to merge 1 commit into
mainfrom
client-read-only

Conversation

@EricPei20

Copy link
Copy Markdown
Contributor

No description provided.

@CSSFrancis CSSFrancis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it might be better to have the read_only as a getter/setter.

    @property
    def read_only(self):
        command = self._addSingleCommand(self.GET_CLIENT_READ_ONLY, None)
        response = self._sendCommand(command)
        if response != False:
            read_only = self.__getParameters(response.acknowledge[0])[0]
        else:
            read_only=None
        return read_only

    @read_only.setter
    def read_only(self, read_only):
        command = self._addSingleCommand(self.SET_CLIENT_READ_ONLY_DEPRECATED, None, [read_only])
        response = self._sendCommand(command)

So then you could have client.read_only=False etc...

Right now the problem is that you can do client.read_only=True and the value will change but nothing will actually change... There are lots of things like if the set fails for some reason the value will not actually update.

@CSSFrancis

Copy link
Copy Markdown
Member

Also if you want the pre-commit test to pass that just requires

pip install pre-commit
pre-commit install

That installs the pre-commit hook to the repo so it will run a code formatting check/ style update every time that code is committed. Just something that helps to keep things easier to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants