from joecceasy import Easy

instructions = "Instructions: " \
"This is some instructional text. It can be multiple lines if you like. " \
"Click Go to get a message!\n"


def onGoButtonClicked():
    global qtui
    qtui.print( "Go button was clicked at epoch time: " \
        f"{Easy.Mods.time.time()}" )


qtui = Easy.Qtui(
    title="JoecceasyQtuiExample",
    instructionsText=instructions,
    showInput=False,
    callbacks={'onGoButtonClicked': onGoButtonClicked},
)
exitCode = qtui.execQapp()  ## qtui.qapp.exec_() would do the same
Easy.Exit(exitCode)  ## just uses sys.exit
Example #2
0
                 title="Joecceasy Qtui  Example - Subclass",
                 showInput=False,
                 autoExpandOutput=True,
                 updateInterval=3000,
                 **kwargs):
        super().__init__(
            *args,
            title=title,
            showInput=showInput,
            autoExpandOutput=autoExpandOutput,
            updateInterval=updateInterval,
            **kwargs,
        )

    def initAdditionalWidgetsIntoDefault(self):
        qw = Easy.Mods.PySide2.QtWidgets
        msgBtn = self.widgets["msgButton"] = qw.QPushButton('click me')
        self.mainLayout.addRow(msgBtn)
        msgBtn.clicked.connect(self.onMsgBtnCicked)

    def onMsgBtnCicked(self):
        self.print("Msg button was clicked.")

    def update(self):
        self.print('Updating (triggered by timer)')


myQtui = MyQtui(title="Joecceasy Qtui Example - Subclass")
exitCode = myQtui.execQapp()
Easy.Exit(exitCode)
Example #3
0
        ## a standalone short video
        'https://www.youtube.com/watch?v=UO_QuXr521I',
        ## aaa-supershort playlist
        'https://www.youtube.com/playlist?list=PLiCtOh7e1jKo5v8aIhKMxH56baLU5xlHJ',
        ## should always fail because it's in the above playlist
        'https://www.youtube.com/watch?v=9RTaIpVuTqE',
    ]
    Easy.Ytdl(
        urls,
        location,
    )


if __name__ == '__main__':
    main()
'''
class EasyYt(Easy.Qtui):
    def __init__(
            self,
            *args,
            title="JoeccToMp3",
            showInput=False,
            autoExpandOutput=True,
            useTabs=False,
            updateInterval=3000,
            useStatusBar=False,
            **kwargs
            ):
        
        self.isConversionInProgress=False