Hey Marcus, It's a cool goal that you are trying to make everyone's workflows more compatible and consistent. Keep it up.
Quick question about the approach to providing the convert functionality... Do you think splitting the file on a '\n' and doing line-by-line string replacements is a viable approach? Could it be possible to break the code if someone has a '\n' in some text of their widget or the word 'PySide2"? I know its pretty specific right now with the 2 replacements its doing, but you might end up adding more changes once you get feedback. Have you looked at a safe approach that parses and rewrites the AST? Something like the rope project <https://github.com/python-rope/rope/blob/master/docs/library.rst#performing-refactorings> or even the ast stdlib module if you are really against dependencies? At least you could be sure that you are only refactoring, say, the renaming of an import. Or renaming a method of a class. Just throwing that out there to see if it helps. Justin On Thu, Sep 8, 2016 at 9:00 AM Marcus Ottosson <[email protected]> wrote: > Hi all, > > Many of you have been asking about working with ui files in a way > maintains the cross-binding benefit of Qt.py. > > The problem has been that: > > - a) PySide and PyQt implement the in-memory loading mechanism loadUi() > differently and > - b) Files compiled via the command-line leave artifacts behind that > make it difficult to run the result on another binding. > > One suggestion was to: > > 1. Compile to Python via PySide2 > 2. Convert to cross-compatible Qt.py code afterwards. > > So that’s what is happening here. > > - https://github.com/mottosso/Qt.py/pull/132 > > $ pyside2-uic my_ui.ui -o my_ui.py > $ python -m Qt --convert my_ui.py > $ cat my_ui_.py > > What we need now is: > > 1. Loads of .ui files to test with (if you have a stash, now’s the > time to share!) > 2. Your feedback on whether this approach is one worth pursuing > > Let me know what you think! > > Best, > Marcus > > -- > *Marcus Ottosson* > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAjdKbcXmfG1LNSyA514-HC9XC3UkxtXq0fNUb6Nj%2BAJg%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAjdKbcXmfG1LNSyA514-HC9XC3UkxtXq0fNUb6Nj%2BAJg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1oNG3qmkTXajcrfnTGLvoonZJ_PBmmnjSO3kqZYVEA9Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
