Skip to content
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

Start adding types and cleaning up classes.py #28

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dunngitter
Copy link
Contributor

@dunngitter dunngitter commented Feb 23, 2025

also start cleaning up stashapp.py and stashbox.py a little bit

added a get_logger method to log.py which can be used instead of import stashapi.log as log

Totally untested so far

also start cleaning up stashapp.py and stashbox.py a little bit
added a `get_logger` method to log.py which can be used instead of
`import stashapi.log as log`
import stashapi.log as logger

self.log = logger
super().__init__(conn.get("Logger", None) or get_logger())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there ever actually a logger in the connection parameters? If so, what does it look like? The documentation on the plugin task inputs doesn't mention this field:

Plugin task input
Plugin tasks may accept an input from the stash server. This input is encoded according to the interface, and has the following structure (presented here in JSON format):

{
"server_connection": {
"Scheme": "http",
"Port": 9999,
"SessionCookie": {
"Name":"session",
"Value":"cookie-value",
"Path":"",
"Domain":"",
"Expires":"0001-01-01T00:00:00Z",
"RawExpires":"",
"MaxAge":0,
"Secure":false,
"HttpOnly":false,
"SameSite":0,
"Raw":"",
"Unparsed":null
},
"Dir": ,
"PluginDir": ,
},
"args": {
"argKey": "argValue"
}
}
The server_connection field contains all the information needed for a plugin to access the parent stash server, if necessary.

Copy link
Owner

Choose a reason for hiding this comment

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

logger is a non standard input that is indented to be passed from a plugin so that the log config consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok cool that was my guess, I think this should work then

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