Пример #1
0
    def runFBA(self, quark):
        if not self.checkRom():
            return
        if not self.fba:
            self.sigStatusMessage.emit("Please configure Setting > Locate ggpofba.exe")
            return
        wine = ''
        args = []
        if IS_WINDOWS:
            args = [self.fba, quark, '-w']
        else:
            wine = findWine()
            if not wine:
                self.sigStatusMessage.emit("Please configure Setting > Locate wine")
                return
            if IS_LINUX:
                args = [packagePathJoin('ggpo', 'scripts', 'ggpofba.sh'), wine, self.fba, quark]
            else:
                args = [wine, self.fba, quark]

        logdebug().info(" ".join(args))
        try:
            # starting python from cmd.exe and redirect stderr and we got
            # python WindowsError(6, 'The handle is invalid')
            # apparently it's still not fixed
            if IS_WINDOWS:
                Popen(args)
            else:
                devnull = open(os.devnull, 'w')
                Popen(args, stdout=devnull, stderr=devnull)
                devnull.close()
        except OSError, ex:
            self.sigStatusMessage.emit("Error executing " + " ".join(args) + "\n" + repr(ex))
Пример #2
0
 def locateWine(self):
     if IS_WINDOWS:
         return
     defaultLocation = findWine()
     if not defaultLocation:
         defaultLocation = os.path.expanduser("~")
     fname = QtGui.QFileDialog.getOpenFileName(self, 'Locate wine', defaultLocation, "wine (wine)")
     if fname:
         Settings.setValue(Settings.WINE_LOCATION, fname)
Пример #3
0
    def runFBA(self, quark):
        if not self.checkRom():
            return
        if not self.fba:
            self.sigStatusMessage.emit(
                "Please configure Setting > Locate ggpofba.exe")
            return
        wine = ''
        args = []
        fba = self.fba
        if IS_WINDOWS:
            if Settings.value(Settings.SERVER_ADDRESS) == 'ggpo.net':
                ngexe = os.path.join(os.path.dirname(fba), 'ggpofba-ng.exe')
                if os.path.exists(ngexe):
                    fba = ngexe
            args = [fba, quark, '-w']
        else:
            wine = findWine()
            if Settings.value(Settings.SERVER_ADDRESS) != 'ggpo.net':
                fba = fba.replace('.exe', '.py')
                if IS_LINUX:
                    args = [
                        packagePathJoin('ggpo', 'scripts', 'ggpofba.sh'), fba,
                        quark
                    ]
                else:
                    args = [fba, quark]
            else:
                if not wine:
                    self.sigStatusMessage.emit(
                        "Please configure Setting > Locate wine")
                    return
                if IS_LINUX:
                    args = [
                        packagePathJoin('ggpo', 'scripts', 'ggpofba.sh'), wine,
                        fba, quark
                    ]
                else:
                    args = [wine, fba, quark]

        logdebug().info(" ".join(args))
        try:
            # starting python from cmd.exe and redirect stderr and we got
            # python WindowsError(6, 'The handle is invalid')
            # apparently it's still not fixed
            if IS_WINDOWS:
                Popen(args)
            else:
                devnull = open(os.devnull, 'w')
                Popen(args, stdout=devnull, stderr=devnull)
                devnull.close()
        except OSError, ex:
            self.sigStatusMessage.emit("Error executing " + " ".join(args) +
                                       "\n" + repr(ex))
Пример #4
0
 def checkInstallation(self):
     fba = Settings.value(Settings.GGPOFBA_LOCATION)
     if fba and os.path.isfile(fba):
         self.fba = os.path.abspath(fba)
     wine = findWine()
     if self.fba and wine:
         return True
     else:
         msg = ''
         if not self.fba:
             msg += "ggpo installation not found\n"
         if not wine:
             msg += "wine installation not found\n"
         self.sigStatusMessage.emit(msg)
         return False
Пример #5
0
 def checkInstallation(self):
     fba = Settings.value(Settings.GGPOFBA_LOCATION)
     if fba and os.path.isfile(fba):
         self.fba = os.path.abspath(fba)
     wine = findWine()
     if self.fba and wine:
         return True
     else:
         msg = ''
         if not self.fba:
             msg += "ggpo installation not found\n"
         if not wine:
             msg += "wine installation not found\n"
         self.sigStatusMessage.emit(msg)
         return False
Пример #6
0
    def runFBA(self, quark):
        if not self.checkRom():
            return
        if not self.fba:
            self.sigStatusMessage.emit("Please configure Setting > Locate ggpofba.exe")
            return
        wine = ''
        args = []
        fba = self.fba
        if IS_WINDOWS:
            if Settings.value(Settings.SERVER_ADDRESS) == 'ggpo.net':
                ngexe = os.path.join(os.path.dirname(fba), 'ggpofba-ng.exe')
                if os.path.exists(ngexe):
                    fba = ngexe
            args = [fba, quark, '-w']
        else:
            wine = findWine()
            if Settings.value(Settings.SERVER_ADDRESS) != 'ggpo.net':
                fba = fba.replace('.exe', '.py')
                if IS_LINUX:
                    args = [packagePathJoin('ggpo', 'scripts', 'ggpofba.sh'), fba, quark]
                else:
                    args = [fba, quark]
            else:
                if not wine:
                    self.sigStatusMessage.emit("Please configure Setting > Locate wine")
                    return
                if IS_LINUX:
                    args = [packagePathJoin('ggpo', 'scripts', 'ggpofba.sh'), wine, fba, quark]
                else:
                    args = [wine, fba, quark]

        logdebug().info(" ".join(args))
        try:
            # starting python from cmd.exe and redirect stderr and we got
            # python WindowsError(6, 'The handle is invalid')
            # apparently it's still not fixed
            if IS_WINDOWS:
                Popen(args)
            else:
                devnull = open(os.devnull, 'w')
                Popen(args, stdout=devnull, stderr=devnull)
                devnull.close()
        except OSError, ex:
            self.sigStatusMessage.emit("Error executing " + " ".join(args) + "\n" + repr(ex))