Skip to content

feat: allow stacking of client.request() decorators + code improvements #453

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

Merged

Conversation

FAReTek1
Copy link
Collaborator

@FAReTek1 FAReTek1 commented Aug 4, 2025

I did this while trying to debug #451 (still not resolved)

  • Allows for stacking of @client.request by actually returning the function from the decorator
  • General code style improvements in the cloud requests system. Doesn't actually change functionality
    • use !r flag in f string instead of surrounding replacement text in ''
    • extract function.__name__ if name is None else name
    • rename function to _function to avoid shadowing variable in outer scope
    • Using zip() for iterating through a string, 2 chars at a time, instead of using range len and some multiplication/divison

FAReTek1 and others added 7 commits August 4, 2025 17:32
This is done by returning the function passed into the decorator. This allows you to register a func for both Cloud requests and TWCloud reqs. This commit also does a bit of refactoring
Signed-off-by: faretek <107722825+FAReTek1@users.noreply.github.com>
Signed-off-by: TheCommCraft <79996518+TheCommCraft@users.noreply.github.com>
@TheCommCraft
Copy link
Collaborator

I have improved some indentation

@FAReTek1 FAReTek1 requested a review from TheCommCraft August 5, 2025 01:39
Signed-off-by: faretek <107722825+FAReTek1@users.noreply.github.com>
@FAReTek1
Copy link
Collaborator Author

FAReTek1 commented Aug 5, 2025

I will merge this before more conflicts occur, but it should be tested just to be sure

@FAReTek1 FAReTek1 merged commit 37caa3c into TimMcCool:main Aug 5, 2025
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