简体   繁体   English

如何理解python配置文件中的`::`?

[英]How to understand the `::` in the python config file?

From the github address: 从github地址:

https://github.com/openstack/nova/blob/master/setup.cfg https://github.com/openstack/nova/blob/master/setup.cfg

In the setup.cfg , there is code below: setup.cfg ,有以下代码:

[metadata]
name = nova
summary = Cloud computing fabric controller
description-file =
    README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = http://docs.openstack.org/developer/nova/
classifier =
    Environment :: OpenStack
    Intended Audience :: Information Technology
    Intended Audience :: System Administrators
    License :: OSI Approved :: Apache Software License
    Operating System :: POSIX :: Linux
    Programming Language :: Python
    Programming Language :: Python :: 2
    Programming Language :: Python :: 2.7

The contents in the [] means config name. []的内容表示配置名称。 such as name means key, the below means value. name表示键,以下表示值。

but how about the Environment :: OpenStack , does the :: have practical meaning? 但是Environment :: OpenStack::有实际意义吗?

No, the :: has no special meaning other that that's the picked delimiter for Trover classifier levels . 不, ::没有其他特殊含义,这是Trover分类器级别选择的定界符。

The classifiers are just metadata, helping people find specific packages and learn what the package is about. 分类器只是元数据,可帮助人们找到特定的包装并了解包装的含义。 The package maintainer picks these when writing the setup.py script; 软件包维护者在编写setup.py脚本时会选择它们。 the setup.cfg file is an alternative way of specifying the same. setup.cfg文件是指定文件名的另一种方法。

The double-colon, in this case, is the classifier namespace separator. 在这种情况下,双冒号是分类器名称空间分隔符。 It is not Python syntax, it's the naming conventions for the categories on PyPI . 它不是Python语法,而是PyPI上类别的命名约定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM