1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""Defines common characteristics of a version at Mozilla."""
"""Enum that sorts types of versions (e.g.: nightly, beta, release, esr).
Supports comparison. `ESR` is considered higher than `RELEASE` (even if they technically have
the same codebase). For instance: 60.0.1 < 60.0.1esr but 61.0 > 60.0.1esr.
This choice has a practical use case: if you have a list of Release and ESR version, you can
easily extract one kind or the other thanks to the VersionType.
Examples:
.. code-block:: python
assert VersionType.NIGHTLY == VersionType.NIGHTLY
assert VersionType.ESR > VersionType.RELEASE
"""
= 1
= 2
= 3
= 4
= 5
"""Implement `==` operator."""
return == 0
"""Implement `!=` operator."""
return != 0
"""Implement `<` operator."""
return < 0
"""Implement `<=` operator."""
return <= 0
"""Implement `>` operator."""
return > 0
"""Implement `>=` operator."""
return >= 0
"""Compare this `VersionType` with anotherself.
Returns:
0 if equal
< 0 is this precedes the other
> 0 if the other precedes this
"""
return -