ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.81k stars 729 forks source link

Four pylint errors in utils and another test failure #301

Open juliangilbey opened 2 years ago

juliangilbey commented 2 years ago

I was looking at issue #298 and have submitted a patch for it. Unfortunately, though, the test still fails, because qdarkstyle.utils.images.create_images() requires the palette passed to it to have an ID component, but when the new palette is created by qdarkstyle.utils.scss.create_custom_qss(), it is not given an ID before calling create_images(). I am not sure what the ID should be, so I'm a little wary of trying to patch it myself.

I did follow the code a little further and stumbled on another issue. So I then decided to run pylint over the whole package, and found four errors in the utils section, so at least they're localised. (All of the other errors reported were false positives due to pylint not being able to identify the contents of pyqt.)

qdarkstyle/utils/__main__.py:60:12: E1120: No value for argument 'palette' in function call (no-value-for-parameter)

This is a call to the run_process function from the QSSFileHandler class. I have no idea what the palette should be, so I don't know how to fix this issue.

qdarkstyle/utils/scss.py:218:17: E1123: Unexpected keyword argument 'qss_filepath' in function call (unexpected-keyword-arg)
qdarkstyle/utils/scss.py:218:17: E1123: Unexpected keyword argument 'main_scss_filepath' in function call (unexpected-keyword-arg)
qdarkstyle/utils/scss.py:218:17: E1123: Unexpected keyword argument 'variables_scss_filepath' in function call (unexpected-keyword-arg)

This is a call to create_qss() which only takes a palette argument, and then defines its own filepaths. Perhaps the intention is that these parameters should override the defaults defined in the current body of the function?

dpizetta commented 2 years ago

Hey, @juliangilbey we need to update this function for creating custom palettes, it is totally out of date after the last big update we have. I'll be working on it, for now, I've just raised a NonImplementedError.