python类StrictVersion()的实例源码

top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
top_block.py 文件源码 项目:GroundStation 作者: ClydeSpace-GroundStation 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
data_structures.py 文件源码 项目:yt 作者: yt-project 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def _is_valid(self, *args, **kwargs):
        """Checks whether the supplied file can be read by this frontend.
        """
        warn_h5py(args[0])
        try:
            f = h5.File(args[0], "r")
        except (IOError, OSError, ImportError):
            return False

        requirements = ["openPMD", "basePath", "meshesPath", "particlesPath"]
        attrs = list(f["/"].attrs.keys())
        for i in requirements:
            if i not in attrs:
                f.close()
                return False

        known_versions = [StrictVersion("1.0.0"),
                          StrictVersion("1.0.1")]
        if StrictVersion(f.attrs["openPMD"].decode()) in known_versions:
            f.close()
            return True
        else:
            f.close()
            return False
secplus_rx.py 文件源码 项目:secplus 作者: argilo 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def main(top_block_cls=secplus_rx, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
gbq.py 文件源码 项目:pandas-gbq 作者: pydata 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def _check_google_client_version():

    try:
        import pkg_resources

    except ImportError:
        raise ImportError('Could not import pkg_resources (setuptools).')

    # Version 0.28.0 includes many changes compared to previous versions
    # https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/bigquery/CHANGELOG.md
    bigquery_client_minimum_version = '0.28.0'

    _BIGQUERY_CLIENT_VERSION = pkg_resources.get_distribution(
        'google-cloud-bigquery').version

    if (StrictVersion(_BIGQUERY_CLIENT_VERSION) <
            StrictVersion(bigquery_client_minimum_version)):
        raise ImportError('pandas requires google-cloud-bigquery >= {0} '
                          'for Google BigQuery support, '
                          'current version {1}'
                          .format(bigquery_client_minimum_version,
                                  _BIGQUERY_CLIENT_VERSION))
blendergltf.py 文件源码 项目:blendergltf 作者: Kupoman 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def export_views(self, state):
        gltf_views = []

        for key, value in self.buffer_views.items():
            gltf = {
                'byteLength': value['bytelength'],
                'byteOffset': value['byteoffset'],
                'name': key,
            }

            if state['version'] >= Version('2.0') and value['bytestride'] > 0:
                gltf['byteStride'] = value['bytestride']

            gltf['buffer'] = Reference('buffers', self.name, gltf, 'buffer')
            state['references'].append(gltf['buffer'])

            if value['target'] is not None:
                gltf['target'] = value['target']

            gltf_views.append(gltf)

            state['input']['bufferViews'].append(SimpleID(key))

        return gltf_views
__init__.py 文件源码 项目:blendergltf 作者: Kupoman 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def update_extensions(self):
        self.ext_prop_to_exporter_map = {ext.ext_meta['name']: ext for ext in self.ext_exporters}

        for exporter in self.ext_exporters:
            exporter.ext_meta['enable'] = False
        for prop in self.extension_props:
            exporter = self.ext_prop_to_exporter_map[prop.name]
            exporter.ext_meta['enable'] = prop.enable

        self.extension_props.clear()
        for exporter in self.ext_exporters:
            prop = self.extension_props.add()
            prop.name = exporter.ext_meta['name']
            prop.enable = exporter.ext_meta['enable']

            if exporter.ext_meta['name'] == 'KHR_technique_webgl':
                prop.enable = Version(self.asset_version) < Version('2.0')
music_processor.py 文件源码 项目:aurora-sdk-win 作者: nanoleaf 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def check_min_versions():
    ret = True

    # pyaudio
    vers_required = "0.2.7"
    vers_current = pyaudio.__version__
    if StrictVersion(vers_current) < StrictVersion(vers_required):
        print("Error: minimum pyaudio vers: {}, current vers {}".format(vers_required, vers_current))
        ret = False

    # librosa
    vers_required = "0.4.3"
    vers_current = librosa.__version__
    if StrictVersion(vers_current) < StrictVersion(vers_required):
        print("Error: minimum librosa vers: {}, current vers {}".format(vers_required, vers_current))
        ret = False

    # numpy
    vers_required = "1.9.0"
    vers_current = np.__version__
    if StrictVersion(vers_current) < StrictVersion(vers_required):
        print("Error: minimum numpy vers: {}, current vers {}".format(vers_required, vers_current))
        ret = False

    return ret
iptables_raw.py 文件源码 项目:ansible_iptables_raw 作者: Nordeus 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def _check_compatibility(self):
        from distutils.version import StrictVersion
        cmd = [self.bins['iptables'], '--version']
        rc, stdout, stderr = Iptables.module.run_command(cmd, check_rc=False)
        if rc == 0:
            result = re.search(r'^ip6tables\s+v(\d+\.\d+)\.\d+$', stdout)
            if result:
                version = result.group(1)
                # CentOS 5 ip6tables (v1.3.x) doesn't support comments,
                # which means it cannot be used with this module.
                if StrictVersion(version) < StrictVersion('1.4'):
                    Iptables.module.fail_json(msg="This module isn't compatible with ip6tables versions older than 1.4.x")
        else:
            Iptables.module.fail_json(msg="Could not fetch iptables version! Is iptables installed?")

    # Read rules from the json state file and return a dict.
rp_eclipse.py 文件源码 项目:piradar 作者: scivision 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main(top_block_cls=top_block, options=None):

    from distutils.version import StrictVersion
    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
        style = gr.prefs().get_string('qtgui', 'style', 'raster')
        Qt.QApplication.setGraphicsSystem(style)
    qapp = Qt.QApplication(sys.argv)

    tb = top_block_cls()
    tb.start()
    if GUI:
        tb.show()

    def quitting():
        tb.stop()
        tb.wait()
    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
    qapp.exec_()
services.py 文件源码 项目:arsenic 作者: HDE 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def _check_version(self):
        if self.version_check:
            output = await run_subprocess([self.binary, '--version'])
            match = self._version_re.search(output)
            if not match:
                raise ValueError(
                    'Could not determine version of geckodriver. To '
                    'disable version checking, set `version_check` to '
                    '`False`.'
                )
            version_str = match.group(1)
            version = StrictVersion(version_str)
            if version < StrictVersion('0.16.1'):
                raise ValueError(
                    f'Geckodriver version {version_str} is too old. 0.16.1 or '
                    f'higher is required. To disable version checking, set '
                    f'`version_check` to `False`.'
                )
test_runner_interface.py 文件源码 项目:MUBench 作者: stg-tud 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def test_no_logs_on_empty_changelogs(self):
        class LegacyInterface(RunnerInterfaceTestImpl): pass

        class NewerInterface(RunnerInterfaceTestImpl): pass

        LegacyInterface.version = lambda *_: StrictVersion("0.0.1")
        NewerInterface.version = lambda *_: StrictVersion("0.0.2")
        NewerInterface.changelog = lambda *_: None
        self.test_interfaces = [LegacyInterface, NewerInterface]
        uut = LegacyInterface('', [])
        uut.logger = MagicMock()

        uut._log_legacy_warning()

        uut.logger.info.assert_not_called()
        uut.logger.warning.assert_not_called()
detector.py 文件源码 项目:MUBench 作者: stg-tud 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, detectors_path: str, detector_id: str, java_options: List[str], requested_release: Optional[str] = None):
        self.id = detector_id
        self.base_name = detector_id.split("_", 1)[0]
        self.path = join(detectors_path, self.id)

        releases_index_path = join(self.path, Detector.RELEASES_FILE)
        release = self._get_release(releases_index_path, requested_release)
        release_tag = release.get("tag", "latest")

        if "cli_version" in release:
            cli_version = StrictVersion(release["cli_version"])
        else:
            raise ValueError("Missing CLI version for {}".format(detector_id))

        self.md5 = release.get("md5", Detector.NO_MD5)

        self.jar_path = join(self.path, self.base_name + ".jar")
        self.jar_url = "{}/{}/{}/{}.jar".format(Detector.BASE_URL, release_tag, cli_version, self.base_name)

        self.runner_interface = RunnerInterface.get(cli_version, self.jar_path, java_options)
deployer.py 文件源码 项目:pear 作者: operatingops 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def get_available_versions():
    client = boto3.client('s3')
    paginator = client.get_paginator('list_objects')
    account_id = boto3.client('sts').get_caller_identity().get('Account')
    region = boto3.session.Session().region_name
    s3_bucket = f'{account_id}-{region}-pear-artifacts'
    versions = list()
    for page in paginator.paginate(Bucket=s3_bucket, Prefix='pear-website/', Delimiter='/'):
        prefixes = page.get('CommonPrefixes')
        try:
            page_versions = [os.path.basename(os.path.dirname(prefix.get('Prefix'))) for prefix in prefixes]
        except TypeError:
            # When there are no prefixes.
            page_versions = list()
        versions.extend(page_versions)
    versions.sort(key=StrictVersion)
    return versions
bootstrap_editorial.py 文件源码 项目:editolido 作者: flyingeek 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def infos_from_giturl(url):
    """
    retrieve the tag or branch from the URL parameter of the action
    :param url: The URL parameter of the action
    :return: tag or branch
    """
    pattern = re.compile(
        r'/(?P<owner>[^/]+)/(?P<name>[^/]+)/archive/(?P<tag>[^/]+)\.zip')
    m = pattern.search(url)
    if m:
        d = m.groupdict()
        if is_branch(d['tag']):
            d['branch'] = d['tag']
            d['version'] = None
            d['branch_release'] = d['tag']
        else:
            d['branch'] = 'master'
            d['branch_release'] = False
            d['version'] = StrictVersion(d['tag'])
    else:
        d = dict(owner=None, name=None, tag=None,
                 branch=None, branch_release=None, version=None)
    return d


问题


面经


文章

微信
公众号

扫码关注公众号