コード例 #1
0
    def on_gpu_button_clicked2(self, widget):
        key = self.combobox_gpu2.get_active_text()
        buf = self.user_input.get_buffer()
        bs = buf.get_bounds()
        user = buf.get_text(bs[0], bs[1], True)
        if not user:
            return

        self.started_gpu2_hs = 0

        self.save_user_conf(user)
        pool = pools_gpu2[key]

        if self.radeon:

            if pool[1] == "xevan":
                path = sgminerxevan_path
            else:
                path = sgminer_path

            platform = self.combobox_gpu2_platform.get_active_text()
            platform = platform.replace("Platform ", "")
            self.conf[
                'platform_radeon'] = self.combobox_gpu2_platform.get_active()
            prc = raw(
                path, self.is_linux
            ) + " --algorithm " + pool[1] + " -o stratum+tcp://" + pool[
                0] + " -u " + user + " -p x --intensity 19 -T -v --gpu-platform " + platform
            if pool[1] == "xevan":
                prc = prc + " --difficulty-multiplier 0.0039"
            print(prc)
            try:
                if self.is_linux:
                    subprocess.call(prc + " > " + dita_dir + os.path.sep +
                                    "gpu2miner.txt &",
                                    shell=True)
                else:
                    print(prc + " > " + raw(dita_dir, self.is_linux) +
                          os.path.sep + "gpu2miner.txt")
                    subprocess.Popen(prc + " > " +
                                     raw(dita_dir, self.is_linux) +
                                     os.path.sep + "gpu2miner.txt",
                                     shell=True,
                                     stdout=sys.stdout,
                                     stderr=sys.stderr)
            except Exception as e:
                print(e)

            self.started_gpu2_title = key
            self.started_gpu2 = True

            self.gpu_button2.set_sensitive(False)
            self.gpu_button2off.set_sensitive(True)
            self.combobox_gpu2.set_sensitive(False)
            self.combobox_gpu2_platform.set_sensitive(False)
    def get_platform(self):
        '''
        return the platform name
        '''
        command = const.CMD_OPTIONS_RRQ
        command_string = b'~Platform\x00'
        response_size = 1024

        cmd_response = self.__send_command(command, command_string,
                                           response_size)
        if cmd_response.get('status'):
            platform = self.__data.split(b'=', 1)[-1].split(b'\x00')[0]
            platform = platform.replace(b'=', b'')
            return platform.decode()
        else:
            raise ZKErrorResponse("Can't get platform")
コード例 #3
0
ファイル: pcommand.py プロジェクト: imayushsaini/ballistica
def make_prefab() -> None:
    """Run prefab builds for the current platform."""
    import subprocess
    import batools.build
    if len(sys.argv) != 3:
        raise RuntimeError('Expected one argument')
    target = batools.build.PrefabTarget(sys.argv[2])
    platform = batools.build.get_current_prefab_platform()

    # We use dashes instead of underscores in target names.
    platform = platform.replace('_', '-')
    try:
        subprocess.run(['make', f'prefab-{platform}-{target.value}-build'],
                       check=True)
    except (Exception, KeyboardInterrupt) as exc:
        if str(exc):
            print(f'make_prefab failed with error: {exc}')
        sys.exit(-1)
コード例 #4
0
ファイル: main.py プロジェクト: DelnarErsike/HIP-tools
def readSteamLibraryFolders(dbPath):
    g_dbg.push('readSteamLibraryFolders("{}")'.format(dbPath))
    folders = []
    with open(dbPath, 'r') as f:
        while True:
            line = f.readline()
            if len(line) == 0:
                g_dbg.pop("numExternalLibrariesFound({})".format(len(folders)))
                return folders
            line = line.rstrip('\n')
            m = re.match(r'^\s*"\d+"\s+"([^"]+)"\s*$', line)
            if m:
                p = m.group(1).replace(r'\\', '/')
                if g_platform == 'cyg':
                    i = p.find(':/')
                    if i == 1:
                        drive = p[:1]
                        p = p.replace(p[:2], '/cygdrive/' + drive.lower(), 1)
                path = os.path.join(os.path.normpath(p), 'steamapps')
                g_dbg.trace('maybeExternalLibrary("{}")'.format(path))
                if os.path.exists(path):
                    g_dbg.trace('externalLibraryExists("{}")'.format(path))
                    folders.append(path)
コード例 #5
0
ファイル: main.py プロジェクト: EMFTeam/HIP-tools
def readSteamLibraryFolders(dbPath):
    g_dbg.push('read_steam_master_library_db("{}")'.format(dbPath))
    p_library = re.compile(r'^\s*"\d+"\s+"([^"]+)"\s*$')
    folders = []
    with open(dbPath, 'rb') as f:
        while True:
            line = f.readline()
            if len(line) == 0:
                g_dbg.pop("num_external_libraries_found({})".format(len(folders)))
                return folders
            line = line.rstrip('\r\n')
            m = p_library.match(line)
            if m:
                p = m.group(1).replace('\\\\', '/')
                if g_platform == 'cyg':
                    i = p.find(':/')
                    if i == 1:
                        drive = p[:1]
                        p = p.replace(p[:2], '/cygdrive/' + drive.lower(), 1)
                path = os.path.join(os.path.normpath(p), 'steamapps')
                g_dbg.trace('external_library("{}")'.format(path))
                if os.path.exists(path):
                    folders.append(path)
コード例 #6
0
 def test_generic_platforms(self):
     platform = distutils.util.get_platform().replace("-", "_")
     platform = platform.replace(".", "_")
     assert list(tags._generic_platforms()) == [platform]
コード例 #7
0
 def test_generic_platforms(self):
     platform = sysconfig.get_platform().replace("-", "_")
     platform = platform.replace(".", "_")
     assert list(tags._generic_platforms()) == [platform]
コード例 #8
0
ファイル: test_tags.py プロジェクト: pypa/packaging
def test_generic_platforms():
    platform = distutils.util.get_platform().replace("-", "_")
    platform = platform.replace(".", "_")
    assert tags._generic_platforms() == [platform]