xcpcio 0.69.2__py3-none-any.whl → 0.69.4__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '0.69.2'
4
+ __version__ = VERSION = '0.69.4'
@@ -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
- await self._clics_client.fetch_api_info()
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. [filepath={}]", filepath)
41
+ logger.warning(f"File not found, will load 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. [filepath={}]", filepath)
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["id"]
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:
xcpcio/types.py CHANGED
@@ -219,7 +219,7 @@ class Contest(BaseModel):
219
219
 
220
220
  options: Optional[ContestOptions] = None
221
221
 
222
- unfrozen_time: int = Field(default=0x3F3F3F3F3F3F3F3F, exclude=True)
222
+ thaw_time: int = Field(default=0x3F3F3F3F3F3F3F3F, exclude=True)
223
223
 
224
224
  def append_balloon_color(self, color: BalloonColor):
225
225
  if self.balloon_color is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xcpcio
3
- Version: 0.69.2
3
+ Version: 0.69.4
4
4
  Summary: xcpcio python lib
5
5
  Project-URL: homepage, https://github.com/xcpcio/xcpcio
6
6
  Project-URL: documentation, https://github.com/xcpcio/xcpcio
@@ -1,7 +1,7 @@
1
1
  xcpcio/__init__.py,sha256=NB6wpVr5JUrOx2vLIQSVtYuCz0d7kNFE39TSQlvoENk,125
2
- xcpcio/__version__.py,sha256=PvjPXbHRuuaoDW81aw_C7GwWvp2Ic1Jtr2QT5eokctk,172
2
+ xcpcio/__version__.py,sha256=mKjZ0ulvhcneyBfnepnueCsbZQFecvS3PwcnzQ9nrGg,172
3
3
  xcpcio/constants.py,sha256=MjpAgNXiBlUsx1S09m7JNT-nekNDR-aE6ggvGL3fg0I,2297
4
- xcpcio/types.py,sha256=GElkg8wz2BloN6PzyjvLrrd2h7Lm5itaaNnZv3hVQ-U,7591
4
+ xcpcio/types.py,sha256=-MbAbQmhTICVfEaafBaOzZ2hz1cquvsRuwAnYPp5tKY,7587
5
5
  xcpcio/api/__init__.py,sha256=fFRUU0d_cUG-uzG2rLgirqRng8Z3UoV5ZCkBiYuXdu0,302
6
6
  xcpcio/api/client.py,sha256=TEcf3tjLu537HHhyBBVHlQ3fFL7_abjG3IrQtp39oks,2389
7
7
  xcpcio/api/models.py,sha256=DBS9TjtPSX32TpwO3gYnnGo7RFHLHrxYpRIAhxCHmLs,1258
@@ -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=6U22U7YYHQY4F4GC8mjyD528QD-LAF5nopHs-zXTeOQ,9930
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=baUEtH62ci4q7yMwR0BnTqUy6YU7zd5XogVVqZtEk0s,15081
43
+ xcpcio/clics/reader/contest_package_reader.py,sha256=W9pNAl6Za1LXG_OjDYj-szVPXczeHBUhL-ajOApL7BU,15089
44
44
  xcpcio/clics/reader/interface.py,sha256=lK2JXU1n8GJ4PecXnfFBijMaCVLYk404e4QwV_Ti2Hk,3918
45
- xcpcio-0.69.2.dist-info/METADATA,sha256=Ez3KGwkANQ9rTmProPurxv1jehMBkyq8fpM9YAvAMLs,2233
46
- xcpcio-0.69.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
47
- xcpcio-0.69.2.dist-info/entry_points.txt,sha256=KxviS5TVXlZ9KqS9UNMx3nI15xhEGvkTq86RaPhUhs4,158
48
- xcpcio-0.69.2.dist-info/RECORD,,
45
+ xcpcio-0.69.4.dist-info/METADATA,sha256=9AlnZZJa2EPfg2ocHYLWsBTnMLTetN8dlgCqTb9h7ck,2233
46
+ xcpcio-0.69.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
47
+ xcpcio-0.69.4.dist-info/entry_points.txt,sha256=KxviS5TVXlZ9KqS9UNMx3nI15xhEGvkTq86RaPhUhs4,158
48
+ xcpcio-0.69.4.dist-info/RECORD,,