當前位置: 首頁>>代碼示例>>Python>>正文


Python version.VersionInfo方法代碼示例

本文整理匯總了Python中pbr.version.VersionInfo方法的典型用法代碼示例。如果您正苦於以下問題:Python version.VersionInfo方法的具體用法?Python version.VersionInfo怎麽用?Python version.VersionInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pbr.version的用法示例。


在下文中一共展示了version.VersionInfo方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_setup_file

# 需要導入模塊: from pbr import version [as 別名]
# 或者: from pbr.version import VersionInfo [as 別名]
def create_setup_file():
    lib_version = VersionInfo("spotify_tensorflow").version_string()
    contents_for_setup_file = """
    import setuptools
    
    if __name__ == "__main__":
        setuptools.setup(
            name="spotify_tensorflow_dataflow",
            packages=setuptools.find_packages(),
            install_requires=[
                "spotify-tensorflow=={version}"
        ])
    """.format(version=lib_version)  # noqa: W293
    setup_file_path = os.path.join(tempfile.mkdtemp(), "setup.py")
    with open(setup_file_path, "w") as f:
        f.writelines(textwrap.dedent(contents_for_setup_file))
    return setup_file_path 
開發者ID:spotify,項目名稱:spotify-tensorflow,代碼行數:19,代碼來源:utils.py

示例2: run

# 需要導入模塊: from pbr import version [as 別名]
# 或者: from pbr.version import VersionInfo [as 別名]
def run(self):
        log.info("[pbr] Extracting rpm version")
        name = self.distribution.get_name()
        print(version.VersionInfo(name).semantic_version().rpm_string()) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:6,代碼來源:packaging.py

示例3: print_version

# 需要導入模塊: from pbr import version [as 別名]
# 或者: from pbr.version import VersionInfo [as 別名]
def print_version():
    """Print version number and exit."""
    from pbr.version import VersionInfo
    version = VersionInfo('faucet').semantic_version().release_string()
    message = 'Faucet %s' % version
    print(message) 
開發者ID:faucetsdn,項目名稱:faucet,代碼行數:8,代碼來源:__main__.py

示例4: __init__

# 需要導入模塊: from pbr import version [as 別名]
# 或者: from pbr.version import VersionInfo [as 別名]
def __init__(self, reg=None):
        if reg is not None:
            self._reg = reg
        self.version = VersionInfo('faucet').semantic_version().release_string()
        self.faucet_version = PromGauge( # pylint: disable=unexpected-keyword-arg
            'faucet_pbr_version',
            'Faucet PBR version',
            ['version'],
            registry=self._reg)
        self.faucet_version.labels(version=self.version).set(1)  # pylint: disable=no-member
        self.server = None
        self.thread = None 
開發者ID:faucetsdn,項目名稱:faucet,代碼行數:14,代碼來源:prom_client.py

示例5: inject_common_paths

# 需要導入模塊: from pbr import version [as 別名]
# 或者: from pbr.version import VersionInfo [as 別名]
def inject_common_paths():
    """Discover the path to the common/ directory provided by infrared core."""
    def override_conf_path(common_path, envvar, specific_dir):
        conf_path = os.environ.get(envvar, '')
        additional_conf_path = os.path.join(common_path, specific_dir)
        if conf_path:
            full_conf_path = ':'.join([additional_conf_path, conf_path])
        else:
            full_conf_path = additional_conf_path
        os.environ[envvar] = full_conf_path

    version_info = version.VersionInfo('infrared')

    common_path = pkg.resource_filename(version_info.package,
                                        'common')
    override_conf_path(common_path, 'ANSIBLE_ROLES_PATH', 'roles')
    override_conf_path(common_path, 'ANSIBLE_FILTER_PLUGINS', 'filter_plugins')
    override_conf_path(common_path, 'ANSIBLE_CALLBACK_PLUGINS',
                       'callback_plugins')
    override_conf_path(common_path, 'ANSIBLE_LIBRARY', 'library')


# This needs to be called here because as soon as an ansible class is loaded
# the code in constants.py is triggered. That code reads the configuration
# settings from all sources (ansible.cfg, environment variables, etc).
# If the first include to ansible modules is moved deeper in the InfraRed
# code (or on demand), then this call can be moved as well in that place. 
開發者ID:redhat-openstack,項目名稱:infrared,代碼行數:29,代碼來源:main.py


注:本文中的pbr.version.VersionInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。