コード例 #1
0
ファイル: installer.py プロジェクト: eddiellopez/prosecco
 def install(self, path):
     """Installs the prgram using wine"""
     print("Installing: " + path)
     uri = urllib.parse.urlparse(path)
     qprocess = QProcess()
     qprocess.finished.connect(self.onFinished)
     qprocess.errorOccurred.connect(self.onErrorOccurred)
     qprocess.setProgram("wine")
     qprocess.setArguments(["".join(uri[1:])])
     # qprocess.start() # This Crashes
     qprocess.startDetached()  # This does not supports signals
コード例 #2
0
ファイル: utils.py プロジェクト: pvtbox/pvtbox-desktop
def qt_reveal_file_in_file_manager(path):
    if not exists(path) and exists(path + FILE_LINK_SUFFIX):
        path += FILE_LINK_SUFFIX
    try:
        while not exists(path):
            path = dirname(path)
    except Exception:
        return

    system = get_platform()
    if system == 'Darwin':
        args = [
            "-e", 'tell application "Finder"', "-e", "activate", "-e",
            'select POSIX file "{}"'.format(path), "-e", "end tell", "-e",
            "return"
        ]
        process = QProcess()
        if not process.execute("/usr/bin/osascript", args):
            return

    elif system == 'Windows':
        args = [QDir.toNativeSeparators(path)]
        if not isdir(path):
            args.insert(0, "/select,")
        process = QProcess()
        if process.startDetached("explorer", args):
            return

    qt_open_path(path if isdir(path) else dirname(path))
コード例 #3
0
def start_guardian_detached():
    logging.info('starting guardian process')
    guardian_loc = 'C:\\Program Files (x86)\\PWUploader\\PWGuardian.exe'
    processes = (p.name() for p in psutil.process_iter())
    guardian_running = "PWGuardian.exe" in processes
    if not guardian_running:
        process = QProcess()
        res, pid = process.startDetached(guardian_loc, [""], "")
        if res == False:
            logging.error('Unable to start the guardian process. %s', UUID)
        else:
            logging.info(f'Started PWGuardian.exe, pid: {pid}')
コード例 #4
0
 def OpenAudioPath(self):
     if self.audioData:
         process = QProcess()
         path = "explorer.exe /select,\"{}\"".format(self.audioData)
         process.startDetached(path)
     return