Separating out PySide UI code


Hello all,

I’m wanting to port out PySide code(UI Code only) so that I have separate modules, but can’t seem to get to where I need to be on it.
My main desire is to just have the be the central script that grabs everything from, but I can’t seem to figure out how to inherit the Widget information from the other code.
Essentially, there is QWidget code in and I want to read that code.

I currently have this folder structure:

I’m using the as the main hub for everything, as being my main PySide QWidget instance.
This is my code(trimmed down to the necessities)

import libs.awRenamer as AWR
import libs.awMirrorObj as AMO

def showui():
    main_window = maya.OpenMayaUI.MQtUtil.mainWindow()
    return wrapInstance(long(main_window), QWidget)

class AWTools_UI(QDialog):
    def __init__(self, parent=showui()):
        super(AWTools_UI, self).__init__(parent)

    def start(self):
        self.setWindowTitle('Alex Rigging Tools')
        self.setMinimumSize(400, 750)
        self.setMaximumSize(400, 750)


And in the other code(libraries that I want to reach), I just have the main functions like

def searchReplace(searchFor, replaceWith, currentSelection):
    for selected in currentSelection:
        name = selected.replace(searchFor, replaceWith)
        pmc.rename(selected, name)

But like I said above, I want the UI code to be in there as well and I want the QWidget instance from to pull in any information from an instance in
I’ve tried a bunch of stuff, but can’t seem to figure something out and haven’t found any examples doing what I’d like to do.
Hopefully this made sense. Thanks.

Edit: I think I came up with a better way of explaining:

I have the UI code for each tool segment in the module that it’s supposed to be in. I want to pull from that code and assign it to an object like a QHBoxLayout or a QWidget(not sure of what would work yet) that I can then assign to a position in the UI in the code.