xcpcio 0.69.2__py3-none-any.whl → 0.69.3__py3-none-any.whl
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.
Potentially problematic release.
This version of xcpcio might be problematic. Click here for more details.
- xcpcio/__version__.py +1 -1
- xcpcio/clics/contest_uploader.py +26 -2
- xcpcio/clics/reader/contest_package_reader.py +3 -3
- {xcpcio-0.69.2.dist-info → xcpcio-0.69.3.dist-info}/METADATA +1 -1
- {xcpcio-0.69.2.dist-info → xcpcio-0.69.3.dist-info}/RECORD +7 -7
- {xcpcio-0.69.2.dist-info → xcpcio-0.69.3.dist-info}/WHEEL +0 -0
- {xcpcio-0.69.2.dist-info → xcpcio-0.69.3.dist-info}/entry_points.txt +0 -0
xcpcio/__version__.py
CHANGED
xcpcio/clics/contest_uploader.py
CHANGED
|
@@ -193,6 +193,24 @@ class ContestUploader:
|
|
|
193
193
|
else:
|
|
194
194
|
logger.warning(f"No validation result for {file_key}, will retry on next poll")
|
|
195
195
|
|
|
196
|
+
async def _fetch_api_data(
|
|
197
|
+
self,
|
|
198
|
+
api_files: Dict[str, FileData],
|
|
199
|
+
changed_api_files: list[str],
|
|
200
|
+
unchanged_files: list[str],
|
|
201
|
+
):
|
|
202
|
+
api_data = await self._clics_client.fetch_api_info()
|
|
203
|
+
if api_data:
|
|
204
|
+
filename = "api.json"
|
|
205
|
+
content = json.dumps(api_data, ensure_ascii=False)
|
|
206
|
+
|
|
207
|
+
if self._cache.has_changed(filename, content):
|
|
208
|
+
checksum = self._cache.calculate_checksum(content)
|
|
209
|
+
api_files[filename] = FileData(content=content, checksum=checksum)
|
|
210
|
+
changed_api_files.append(filename)
|
|
211
|
+
else:
|
|
212
|
+
unchanged_files.append(filename)
|
|
213
|
+
|
|
196
214
|
async def _fetch_contest_data(
|
|
197
215
|
self,
|
|
198
216
|
) -> tuple[Dict[str, FileData], list[str], list[str]]:
|
|
@@ -248,9 +266,15 @@ class ContestUploader:
|
|
|
248
266
|
return response
|
|
249
267
|
|
|
250
268
|
async def fetch_and_upload(self) -> Optional[Dict]:
|
|
251
|
-
|
|
269
|
+
api_files, changed_api_files, unchanged_files = ({}, [], [])
|
|
270
|
+
|
|
271
|
+
await self._fetch_api_data(api_files, changed_api_files, unchanged_files)
|
|
272
|
+
|
|
273
|
+
contest_files, contest_changed, contest_unchanged = await self._fetch_contest_data()
|
|
274
|
+
api_files.update(contest_files)
|
|
275
|
+
changed_api_files.extend(contest_changed)
|
|
276
|
+
unchanged_files.extend(contest_unchanged)
|
|
252
277
|
|
|
253
|
-
api_files, changed_api_files, unchanged_files = await self._fetch_contest_data()
|
|
254
278
|
await self._fetch_endpoint_data(api_files, changed_api_files, unchanged_files)
|
|
255
279
|
|
|
256
280
|
if changed_api_files:
|
|
@@ -38,7 +38,7 @@ class ContestPackageReader(BaseContestReader):
|
|
|
38
38
|
return json.load(f)
|
|
39
39
|
except FileNotFoundError:
|
|
40
40
|
if default_value is not None:
|
|
41
|
-
logger.warning("File not found, will return default value. [
|
|
41
|
+
logger.warning(f"File not found, will return default value. [full_path={full_path}]")
|
|
42
42
|
return default_value
|
|
43
43
|
raise HTTPException(status_code=404, detail=f"File not found: {filepath}")
|
|
44
44
|
except json.JSONDecodeError as e:
|
|
@@ -56,7 +56,7 @@ class ContestPackageReader(BaseContestReader):
|
|
|
56
56
|
return data
|
|
57
57
|
except FileNotFoundError:
|
|
58
58
|
if default_value is not None:
|
|
59
|
-
logger.warning("File not found, will load default value. [
|
|
59
|
+
logger.warning(f"File not found, will load default value. [full_path={full_path}]")
|
|
60
60
|
return default_value
|
|
61
61
|
raise HTTPException(status_code=404, detail=f"File not found: {filepath}")
|
|
62
62
|
except json.JSONDecodeError as e:
|
|
@@ -111,7 +111,7 @@ class ContestPackageReader(BaseContestReader):
|
|
|
111
111
|
self.event_feed = self._load_ndjson_file("event-feed.ndjson", default_value=[])
|
|
112
112
|
self.event_feed_tokens = [event["token"] for event in self.event_feed]
|
|
113
113
|
|
|
114
|
-
self.contest_id = self.contest
|
|
114
|
+
self.contest_id = self.contest.get("id", "")
|
|
115
115
|
|
|
116
116
|
def _get_file_attr(self, expected_href: str, base_path: Path, files: List[Dict]) -> FileAttr:
|
|
117
117
|
for file in files:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
xcpcio/__init__.py,sha256=NB6wpVr5JUrOx2vLIQSVtYuCz0d7kNFE39TSQlvoENk,125
|
|
2
|
-
xcpcio/__version__.py,sha256=
|
|
2
|
+
xcpcio/__version__.py,sha256=R-fwXng-b9alv8lljdhgYSn2tC-cwKkSYHJu34eewE4,172
|
|
3
3
|
xcpcio/constants.py,sha256=MjpAgNXiBlUsx1S09m7JNT-nekNDR-aE6ggvGL3fg0I,2297
|
|
4
4
|
xcpcio/types.py,sha256=GElkg8wz2BloN6PzyjvLrrd2h7Lm5itaaNnZv3hVQ-U,7591
|
|
5
5
|
xcpcio/api/__init__.py,sha256=fFRUU0d_cUG-uzG2rLgirqRng8Z3UoV5ZCkBiYuXdu0,302
|
|
@@ -11,7 +11,7 @@ xcpcio/app/clics_uploader.py,sha256=9sgjnIvmuEhP3LjsdmVa0Rps42ij3j49dHBnr3KsM3I,
|
|
|
11
11
|
xcpcio/clics/__init__.py,sha256=coTZiqxzXesn2SYmI2ZCsDZW6XaFi_6p-PFozZ4dfl4,150
|
|
12
12
|
xcpcio/clics/clics_api_client.py,sha256=N6mYlou6eTrQYiUKxE4fdwCClCt9DrmVyKQmpc53iaY,9670
|
|
13
13
|
xcpcio/clics/contest_archiver.py,sha256=9q3qB4hOPfd4ttaG78cQ7sg7vWkumO_KUZpqwYlHDlM,9933
|
|
14
|
-
xcpcio/clics/contest_uploader.py,sha256=
|
|
14
|
+
xcpcio/clics/contest_uploader.py,sha256=IaN2-SJpQj6K6ZB-yhMZnJm-s_iIgs7tdpZ-I5DD-fo,10851
|
|
15
15
|
xcpcio/clics/api_server/__init__.py,sha256=ASvVJ_ibGkXFDSNmy05eb9gESXRS8hjYHCrBecSnaS0,174
|
|
16
16
|
xcpcio/clics/api_server/app.py,sha256=dYvkxaR8PjkDIHbSX8YyU3TvPud93Dg29k6midylakE,979
|
|
17
17
|
xcpcio/clics/api_server/dependencies.py,sha256=2Zhom6vUnAOikr9bh-_kXYCc3g6JGXReVuQX7Ok90r4,1444
|
|
@@ -40,9 +40,9 @@ xcpcio/clics/model/__init__.py,sha256=cZE1q5JY-iHDEKZpsx0UZaMhH-23H4oAHaYOkW7dZ5
|
|
|
40
40
|
xcpcio/clics/model/model_2023_06/__init__.py,sha256=VzBaFcAwYw9G18p0Lh7rNPrvchyaYx_jgw6YE4W1yNg,168
|
|
41
41
|
xcpcio/clics/model/model_2023_06/model.py,sha256=bVMDWpJTwPSpz1fHPxWrWerxCBIboH3LKVZpIZGQ2pY,15287
|
|
42
42
|
xcpcio/clics/reader/__init__.py,sha256=Nfi78X8J1tJPh7WeSRPLMRUprlS2JYelYJHW4DfyJ7U,162
|
|
43
|
-
xcpcio/clics/reader/contest_package_reader.py,sha256=
|
|
43
|
+
xcpcio/clics/reader/contest_package_reader.py,sha256=JzjUioKu-LsaigXW3iDO7eujbZKwTSCTNwJ3yYHrYXM,15091
|
|
44
44
|
xcpcio/clics/reader/interface.py,sha256=lK2JXU1n8GJ4PecXnfFBijMaCVLYk404e4QwV_Ti2Hk,3918
|
|
45
|
-
xcpcio-0.69.
|
|
46
|
-
xcpcio-0.69.
|
|
47
|
-
xcpcio-0.69.
|
|
48
|
-
xcpcio-0.69.
|
|
45
|
+
xcpcio-0.69.3.dist-info/METADATA,sha256=3xO8AlbE6MXCQhI0G7eS7oFGhqUJWo2rOEtEFcwFG7U,2233
|
|
46
|
+
xcpcio-0.69.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
47
|
+
xcpcio-0.69.3.dist-info/entry_points.txt,sha256=KxviS5TVXlZ9KqS9UNMx3nI15xhEGvkTq86RaPhUhs4,158
|
|
48
|
+
xcpcio-0.69.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|