mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-07 08:31:48 +00:00
Python 3.2 workaround: Drop usage of enum module
enum is not yet available in Python 3.2, but as long as snakefruit still runs Ubuntu 12.04 we need to get along without it.
This commit is contained in:
parent
c5c9c6f979
commit
7c6fd99417
@ -1576,9 +1576,9 @@ class Britney(object):
|
|||||||
for policy in self.policies:
|
for policy in self.policies:
|
||||||
if suite in policy.applicable_suites:
|
if suite in policy.applicable_suites:
|
||||||
v = policy.apply_policy(policy_info, suite, src, source_t, source_u, excuse)
|
v = policy.apply_policy(policy_info, suite, src, source_t, source_u, excuse)
|
||||||
if v.value > policy_verdict.value:
|
if v > policy_verdict:
|
||||||
policy_verdict = v
|
policy_verdict = v
|
||||||
if policy_verdict.is_rejected:
|
if policy_verdict in [PolicyVerdict.REJECTED_PERMANENTLY, PolicyVerdict.REJECTED_TEMPORARILY]:
|
||||||
excuse.is_valid = False
|
excuse.is_valid = False
|
||||||
|
|
||||||
if suite in ('pu', 'tpu') and source_t:
|
if suite in ('pu', 'tpu') and source_t:
|
||||||
|
@ -2,7 +2,6 @@ import json
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from enum import Enum, unique
|
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
|
|
||||||
import apt_pkg
|
import apt_pkg
|
||||||
@ -11,8 +10,7 @@ from britney2.hints import Hint, split_into_one_hint_per_package
|
|||||||
from britney2.utils import ensuredir
|
from britney2.utils import ensuredir
|
||||||
|
|
||||||
|
|
||||||
@unique
|
class PolicyVerdict:
|
||||||
class PolicyVerdict(Enum):
|
|
||||||
""""""
|
""""""
|
||||||
"""
|
"""
|
||||||
The migration item passed the policy.
|
The migration item passed the policy.
|
||||||
@ -612,7 +610,7 @@ class PiupartsPolicy(BasePolicy):
|
|||||||
piuparts_info['piuparts-test-url'] = url
|
piuparts_info['piuparts-test-url'] = url
|
||||||
excuse.addhtml(msg)
|
excuse.addhtml(msg)
|
||||||
|
|
||||||
if result.is_rejected:
|
if result in [PolicyVerdict.REJECTED_PERMANENTLY, PolicyVerdict.REJECTED_TEMPORARILY]:
|
||||||
for ignore_hint in self.hints.search('ignore-piuparts',
|
for ignore_hint in self.hints.search('ignore-piuparts',
|
||||||
package=source_name,
|
package=source_name,
|
||||||
version=source_data_srcdist.version):
|
version=source_data_srcdist.version):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user