libmozdata 0.2.9__tar.gz → 0.2.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libmozdata-0.2.9/libmozdata.egg-info → libmozdata-0.2.10}/PKG-INFO +1 -1
- libmozdata-0.2.10/VERSION +1 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/config.py +20 -4
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/lando.py +7 -5
- {libmozdata-0.2.9 → libmozdata-0.2.10/libmozdata.egg-info}/PKG-INFO +1 -1
- libmozdata-0.2.9/VERSION +0 -1
- {libmozdata-0.2.9 → libmozdata-0.2.10}/MANIFEST.in +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/README.md +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/BZInfo.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/FXRevision.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/FileStats.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/HGFileInfo.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/__init__.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/bugzilla.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/buildhub.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/clouseau.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/connection.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/fx_trains.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/handler.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/hgmozilla.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/modules.json +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/modules.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/patchanalysis.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/phabricator.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/redash.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/release_owners.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/socorro.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/utils.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/vcs_map.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/versions.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata/wiki_parser.py +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata.egg-info/SOURCES.txt +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata.egg-info/dependency_links.txt +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata.egg-info/not-zip-safe +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata.egg-info/requires.txt +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/libmozdata.egg-info/top_level.txt +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/requirements.txt +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/setup.cfg +0 -0
- {libmozdata-0.2.9 → libmozdata-0.2.10}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.10
|
|
@@ -11,12 +11,19 @@ except ImportError:
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Config(object):
|
|
14
|
-
def
|
|
15
|
-
|
|
14
|
+
def __init__(self):
|
|
15
|
+
self.local_config = {}
|
|
16
|
+
|
|
17
|
+
def set_default(self, section, option, value):
|
|
18
|
+
self.local_config[(section, option)] = value
|
|
19
|
+
|
|
20
|
+
def get(self, section, option, default=None):
|
|
21
|
+
return self.local_config.get((section, option), default)
|
|
16
22
|
|
|
17
23
|
|
|
18
24
|
class ConfigIni(Config):
|
|
19
25
|
def __init__(self, path=None):
|
|
26
|
+
super().__init__()
|
|
20
27
|
self.config = ConfigParser()
|
|
21
28
|
if path is not None:
|
|
22
29
|
self.config.read(path)
|
|
@@ -32,7 +39,9 @@ class ConfigIni(Config):
|
|
|
32
39
|
|
|
33
40
|
def get(self, section, option, default=None, type=str):
|
|
34
41
|
if not self.config.has_option(section, option):
|
|
35
|
-
|
|
42
|
+
if default is not None:
|
|
43
|
+
return default
|
|
44
|
+
return super().get(section, option)
|
|
36
45
|
|
|
37
46
|
res = self.config.get(section, option)
|
|
38
47
|
if type == list or type == set:
|
|
@@ -48,7 +57,9 @@ class ConfigEnv(Config):
|
|
|
48
57
|
def get(self, section, option, default=None, type=str):
|
|
49
58
|
env = os.environ.get("LIBMOZDATA_CFG_" + section.upper() + "_" + option.upper())
|
|
50
59
|
if not env:
|
|
51
|
-
|
|
60
|
+
if default is not None:
|
|
61
|
+
return default
|
|
62
|
+
return super().get(section, option)
|
|
52
63
|
|
|
53
64
|
if type == list or type == set:
|
|
54
65
|
return type([s.strip(" /t") for s in env.split(",")])
|
|
@@ -72,3 +83,8 @@ def get(section, option, default=None, type=str, required=False):
|
|
|
72
83
|
if required:
|
|
73
84
|
assert value is not None, f"Option {option} in section {section} is not set"
|
|
74
85
|
return value
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def set_default_value(section, option, value):
|
|
89
|
+
global __config
|
|
90
|
+
__config.set_default(section, option, value)
|
|
@@ -14,7 +14,7 @@ class LandoWarnings(object):
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
def __init__(self, api_url, api_key):
|
|
17
|
-
self.api_url = f"{api_url}/diff_warnings"
|
|
17
|
+
self.api_url = f"{api_url}/diff_warnings/"
|
|
18
18
|
self.api_key = api_key
|
|
19
19
|
self.USER_AGENT = config.get("User-Agent", "name", required=True)
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ class LandoWarnings(object):
|
|
|
26
26
|
warning_id = warning["id"]
|
|
27
27
|
|
|
28
28
|
response = requests.delete(
|
|
29
|
-
f"{self.api_url}
|
|
29
|
+
f"{self.api_url}{warning_id}",
|
|
30
30
|
headers={
|
|
31
31
|
"X-Phabricator-API-Key": self.api_key,
|
|
32
32
|
"User-Agent": self.USER_AGENT,
|
|
@@ -34,7 +34,9 @@ class LandoWarnings(object):
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
if response.status_code != 200:
|
|
37
|
-
raise Exception(
|
|
37
|
+
raise Exception(
|
|
38
|
+
f"Failed to delete warning with ID {warning_id} with error {response.status_code}:\n{response.text}"
|
|
39
|
+
)
|
|
38
40
|
|
|
39
41
|
def add_warning(self, warning, revision_id, diff_id):
|
|
40
42
|
"""
|
|
@@ -55,7 +57,7 @@ class LandoWarnings(object):
|
|
|
55
57
|
)
|
|
56
58
|
if response.status_code != 201:
|
|
57
59
|
raise Exception(
|
|
58
|
-
f"Failed to add warnings for revision_id {revision_id} and diff_id {diff_id}
|
|
60
|
+
f"Failed to add warnings for revision_id {revision_id} and diff_id {diff_id} with error {response.status_code}:\n{response.text}"
|
|
59
61
|
)
|
|
60
62
|
|
|
61
63
|
def get_warnings(self, revision_id, diff_id):
|
|
@@ -76,7 +78,7 @@ class LandoWarnings(object):
|
|
|
76
78
|
)
|
|
77
79
|
if response.status_code != 200:
|
|
78
80
|
raise Exception(
|
|
79
|
-
f"Failed to get warnings for revision_id {revision_id} and diff_id {diff_id}
|
|
81
|
+
f"Failed to get warnings for revision_id {revision_id} and diff_id {diff_id} with error {response.status_code}:\n{response.text}"
|
|
80
82
|
)
|
|
81
83
|
|
|
82
84
|
return response.json()
|
libmozdata-0.2.9/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.2.9
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|