Exemplo n.º 1
0
def main():
    import sys

    app = QApplication(sys.argv)
    QApplication.setOrganizationName('Akond Lab')
    QApplication.setOrganizationDomain('akond.com')
    QApplication.setApplicationName('WD Wrapper')
    QApplication.setApplicationVersion(__version__)

    tcl = CommandLineSettings()
    parser = QCommandLineParser()
    result = tcl.parseCommandLine(parser)
    if result.result == CommandLineParseResult.CommandLineError:
        print(result.errorMessage, "\n\n", parser.helpText(), file=sys.stderr)
        return 1
    elif result.result == CommandLineParseResult.CommandLineVersionRequested:
        print(QCoreApplication.applicationName(),
              QCoreApplication.applicationVersion(), "\n")
        return 0
    elif result.result == CommandLineParseResult.CommandLineHelpRequested:
        parser.showHelp()
        return 0

    mainWin = MainWindow()
    # mainWin.resize(800, 600)   # now in config, see: MainWindow.readWindowSettings
    mainWin.show()

    sys.exit(app.exec_())
Exemplo n.º 2
0
def checkUpdatesAvailable():
    from requests import get
    releasesInformation = get('https://api.github.com/repos/ketsu8/colorcode/releases').json()
    
    currentVersion = QCoreApplication.applicationVersion()
    latestReleaseInformation = {'tag_name' : currentVersion}

    if preReleasesEnable == True:
        latestReleaseInformation = releasesInformation[0]
    else:
        for release in releasesInformation:
            if release['prerelease'] == True: continue
            latestReleaseInformation = release

    return False if latestReleaseInformation['tag_name'] == currentVersion else True
Exemplo n.º 3
0
 def setTitle(self):
     p = ' - ' + os.path.basename(self.path) if self.path else ''
     self.setWindowTitle(QCoreApplication.applicationName() + ' ' + QCoreApplication.applicationVersion() + p)