ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

3 July 2020
2020-07-03×
3 July 2020
Ë
Say uic.exe takes care of what pyside2uic did from version 5.14 on, right?
if you are planning just to transform a .ui file to a .py file, then yes
C
pyside2-uic calls underneath to uic -g python
Ë
Ah ok! alright. But there is nothing from within python anymore, right?
C
Were you looking for a specific functionallity?
Oh hell no! I don't like "loading" ui-files! (I'm probably a bit too harsh about it... but I think it should be forbidden)
Ë
Ссылка
click to show
To be honest: I implemented using uic.exe as a fallback. see. As I'm not happy with the resulting Python code quality. I see it's solid and it works and it's probably the best way to do it via one and only one thing, namely uic.
since it does the same you have there
but it gets an instance of the class
C
instead of generating the physical file
C
that usually is part of the process before executing the main code
maybe you can replace the call from 'uic -g python', for 'pyside2-uic' then
some times people don't have 'uic' in path
C
since it's deployed in the wheel, but not on the 'bin/' directory
also * one is able to remove the .ui files from a release
Ë
Nah I construct the absolute path there.
Ë
So. A man is unhappy with uic Python code quality... What does he do? I guess as this is not a "blocker" it would not be a priority to fix officially. So: I'm thinking about working on it myself. But then: Is there reason to believe that this kind of "beautifications" will ever make it into the real thing?
Ë
An alternative would be to fork an oldschool pyside2uic and work on that instead.
pyside2uic was full of bugs, since it was an old fork from what the folks at pyqt5 use. That's why we wanted to add official support to 'uic' instead of having yet another code that do the same.
C
you can always modify uic, and submit patches to improve the python code
Ë
Cristián 🥑what is the problem with the uic python code?
pylint makes it blink like a Christmas tree. The docstring is big #-comment-block instead of """docstring""" There are all these unused from Pyside2.QtCore imports, since Python 3 simple should be written without (object): class Ui_Form: when there are QTableWidgets the if clauses are in (parenthesis) the naming style could be more pep8-ish: setup_ui, retranslate_ui I'd actually like to inject some # pylint: disable=W0201,C0103,C0111' 2 blank lines in the end ...
F
Why not just exclude those files from pylint?
Well IF you could have generated code to be beautiful? Wouldn't you rather have that instead of making your linter look away completely?
Ë
It's not like magic. 🦄
F
What's up with the constant passive-aggressiveness?
F
Okay - maybe it's just me reading things that way then, text-only communication can be ambiguous sometimes :)
Well. I need a fork of the whole Qt project, right? 🤔
Ë
OK. No. I "just" need a clone! 👍
just clone the qtbase repository
take a look inside src/tools/uic/
and you can grep around to find where the imports and other things are generated
if you have qt5 in your system, you might be able to just build uic instead of building the whole qtbase
J
If it's python code, maybe use black if you like the style ?
I got the account. 👍 Logged into Gerrit. Sure thanks a lot!
Ë
You mean run uic and then black on top?
J
If it's python code it should work
Well doesn't hurt to have a look into building something once in a while. If it produces better code right away, thats even better I'd say
J
Maybe you can pipe uic (if return code to stdout) and black since black accept code from stdin
Calendar: July 2020
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog