-
Notifications
You must be signed in to change notification settings - Fork 8
Improve clientmove function #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Add support for moving multiple clients at once - Add support for additional parameters
|
Mhmm, I don't get this CodeQL error. Since it's a beta check and I haven't changed anything related to this mentioned error, I would say, my code should be fine. 😅 |
|
Thanks for contributing again! The CodeQL error is not your fault, it's probably because the offending code is in the same file. I will have a look at your changes tomorrow! |
|
I think this is overall a good change, but I am unsure if renaming the |
|
Yeah, difficult. 😅 I mean, when somebody updates this package in a project, the person should also take a look at the changes and latest then, this change should be visible. Usually you also update things, test them and deploy them afterwards in production, so during testing they should get an error, that the parameter with the old name does not exist (anymore). |
| :param channel_id: Channel to move client to. | ||
| :param client_id: Id of the client to move. | ||
| :param client_ids: List of client Ids or a single client Id to move. | ||
| :param params: List of parameters to update in the form param=value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the addition of params (especially, since clientmove seems to have a channelpw parameter that I haven't implemented). However, I am unsure about this implementation:
- I think the ability to additional parameters should be provided for all commands (in case the commands change over time)
- I don't particularly like that it is just a string. I would rather work with **kwargs and build the string from that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback. I'll take a look at it asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at your feedback.
I don't particularly like that it is just a string. I would rather work with **kwargs and build the string from that.
You are talking here about the client_ids, or? Because the params should be already in the respective format.
I'm not really sure, if it's really a good idea to change this here at the moment from my solution to something else. I decided myself for this solution to keep the backward compatibilty for other API users as it was. We could think about changing this overall in a new major version.
What do you think about this?
- For now, only change this single function to support params.
- Improve overall code with e.g. PyLint and Black (Formatter). I can provide Github workflows for this and adjust the code. This will just take some time as you have a lot of code here, which needs some small adjustments. 😅
- Refactor / Improve existing code to support params for all functions (which support params). We could also add it to functions, which do not support params, but this doesn't make sense. Let's rather fail if too many params were given.
- Release new major version.
To keep the old functionality, I've implemented a logic to archive this, so that existing code of other people don't needs to be changed.