参考模型¶
- class RecipeReference(name=None, version=None, user=None, channel=None, revision=None, timestamp=None)¶
配方的精确(无版本范围、无别名)引用,它代表形式为
name/version[@user/channel][#revision][%timestamp]的引用。它足以在缓存或服务器中定位配方,验证将在此类之外进行,在特定点(export、api 等)。属性应被视为不可变的,用户不应修改它们。
- name: str¶
引用的名称
- user¶
引用的用户,如果有的话
- channel¶
引用的频道,如果有的话
- revision¶
引用的修订版本,如果有的话
- timestamp¶
引用的时间戳,如果有的话
- static loads(rref)¶
从字符串实例化一个对象,格式为:
name/version[@user/channel][#revision][%timestamp]
- validate_ref(allow_uppercase=False)¶
检查引用是否有效,如果无效则抛出
ConanException。
- matches(pattern, is_consumer)¶
使用 fnmatch 匹配提供的模式与引用。
- 参数:
pattern (str) – 用于匹配的模式,它可以包含通配符,并且可以以
!或~开头来否定匹配。特殊值&仅在is_consumer为True时才返回匹配。is_consumer (bool) – 如果为
True,则模式&将匹配此引用。