xcpcio 0.69.4__py3-none-any.whl → 0.74.0__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/app/clics_uploader.py +3 -0
- xcpcio/clics/contest_uploader.py +4 -5
- xcpcio/types.py +20 -0
- {xcpcio-0.69.4.dist-info → xcpcio-0.74.0.dist-info}/METADATA +2 -2
- {xcpcio-0.69.4.dist-info → xcpcio-0.74.0.dist-info}/RECORD +8 -8
- {xcpcio-0.69.4.dist-info → xcpcio-0.74.0.dist-info}/WHEEL +0 -0
- {xcpcio-0.69.4.dist-info → xcpcio-0.74.0.dist-info}/entry_points.txt +0 -0
xcpcio/__version__.py
CHANGED
xcpcio/app/clics_uploader.py
CHANGED
|
@@ -30,6 +30,7 @@ def setup_logging(level: str = "INFO"):
|
|
|
30
30
|
)
|
|
31
31
|
@click.option("--timeout", default=30, type=int, help="Request timeout in seconds")
|
|
32
32
|
@click.option("--max-concurrent", default=10, type=int, help="Max concurrent requests for CLICS API")
|
|
33
|
+
@click.option("--interval", default=5, type=int, help="Polling interval in seconds")
|
|
33
34
|
@click.option(
|
|
34
35
|
"--log-level",
|
|
35
36
|
default="INFO",
|
|
@@ -47,6 +48,7 @@ def main(
|
|
|
47
48
|
cache_dir: Optional[Path],
|
|
48
49
|
timeout: int,
|
|
49
50
|
max_concurrent: int,
|
|
51
|
+
interval: int,
|
|
50
52
|
log_level: str,
|
|
51
53
|
verbose: bool,
|
|
52
54
|
):
|
|
@@ -76,6 +78,7 @@ def main(
|
|
|
76
78
|
cache_dir=cache_dir,
|
|
77
79
|
timeout=timeout,
|
|
78
80
|
max_concurrent=max_concurrent,
|
|
81
|
+
poll_interval=interval,
|
|
79
82
|
version=__version__,
|
|
80
83
|
)
|
|
81
84
|
|
xcpcio/clics/contest_uploader.py
CHANGED
|
@@ -15,8 +15,6 @@ from xcpcio.clics.clics_api_client import APICredentials, ClicsApiClient, ClicsA
|
|
|
15
15
|
|
|
16
16
|
logger = logging.getLogger(__name__)
|
|
17
17
|
|
|
18
|
-
POLL_INTERVAL = 5
|
|
19
|
-
|
|
20
18
|
|
|
21
19
|
class FileChecksumEntry(BaseModel):
|
|
22
20
|
checksum: str
|
|
@@ -129,6 +127,7 @@ class UploaderConfig:
|
|
|
129
127
|
cache_dir: Optional[Path] = None
|
|
130
128
|
timeout: int = 30
|
|
131
129
|
max_concurrent: int = 10
|
|
130
|
+
poll_interval: int = 5
|
|
132
131
|
version: Optional[str] = None
|
|
133
132
|
|
|
134
133
|
def to_clics_api_config(self) -> ClicsApiConfig:
|
|
@@ -291,7 +290,7 @@ class ContestUploader:
|
|
|
291
290
|
logger.info(f"All uploads completed! ({len(api_files)} files)")
|
|
292
291
|
return response.model_dump() if response else None
|
|
293
292
|
|
|
294
|
-
async def run_loop(self
|
|
293
|
+
async def run_loop(self):
|
|
295
294
|
iteration = 0
|
|
296
295
|
while True:
|
|
297
296
|
iteration += 1
|
|
@@ -301,5 +300,5 @@ class ContestUploader:
|
|
|
301
300
|
except Exception as e:
|
|
302
301
|
logger.exception(f"Error during fetch and upload: {e}", exc_info=True)
|
|
303
302
|
|
|
304
|
-
logger.info(f"Waiting {poll_interval} seconds until next poll...")
|
|
305
|
-
await asyncio.sleep(poll_interval)
|
|
303
|
+
logger.info(f"Waiting {self._config.poll_interval} seconds until next poll...")
|
|
304
|
+
await asyncio.sleep(self._config.poll_interval)
|
xcpcio/types.py
CHANGED
|
@@ -63,6 +63,7 @@ MedalPreset = Literal["ccpc", "icpc"]
|
|
|
63
63
|
BannerMode = Literal["ONLY_BANNER", "ALL"]
|
|
64
64
|
Lang = Literal["en", "zh-CN"]
|
|
65
65
|
DateTimeISO8601String = str
|
|
66
|
+
UrlString = str
|
|
66
67
|
|
|
67
68
|
|
|
68
69
|
class I18NStringSet(BaseModel):
|
|
@@ -87,6 +88,21 @@ class Image(BaseModel):
|
|
|
87
88
|
height: Optional[int] = None
|
|
88
89
|
|
|
89
90
|
|
|
91
|
+
class DataItem(BaseModel):
|
|
92
|
+
url: UrlString
|
|
93
|
+
version: Optional[str] = None
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class Organization(BaseModel):
|
|
97
|
+
id: str
|
|
98
|
+
name: Text
|
|
99
|
+
|
|
100
|
+
logo: Optional[Image] = None
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
Organizations = List[Organization]
|
|
104
|
+
|
|
105
|
+
|
|
90
106
|
class BalloonColor(BaseModel):
|
|
91
107
|
color: str
|
|
92
108
|
background_color: str
|
|
@@ -146,6 +162,8 @@ class Team(BaseModel):
|
|
|
146
162
|
name: Text = ""
|
|
147
163
|
|
|
148
164
|
organization: str = ""
|
|
165
|
+
organization_id: Optional[str] = None
|
|
166
|
+
|
|
149
167
|
group: List[str] = Field(default_factory=list)
|
|
150
168
|
tag: Optional[List[str]] = None
|
|
151
169
|
|
|
@@ -219,6 +237,8 @@ class Contest(BaseModel):
|
|
|
219
237
|
|
|
220
238
|
options: Optional[ContestOptions] = None
|
|
221
239
|
|
|
240
|
+
organizations: Optional[Union[DataItem, Organizations]] = None
|
|
241
|
+
|
|
222
242
|
thaw_time: int = Field(default=0x3F3F3F3F3F3F3F3F, exclude=True)
|
|
223
243
|
|
|
224
244
|
def append_balloon_color(self, color: BalloonColor):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xcpcio
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.74.0
|
|
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
|
|
@@ -79,7 +79,7 @@ uv run pytest tests/test_types.py
|
|
|
79
79
|
|
|
80
80
|
For detailed documentation, visit:
|
|
81
81
|
|
|
82
|
-
- [
|
|
82
|
+
- [Clics Utility Guide](https://xcpcio.com/guide/clics-utility)
|
|
83
83
|
|
|
84
84
|
## License
|
|
85
85
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
xcpcio/__init__.py,sha256=NB6wpVr5JUrOx2vLIQSVtYuCz0d7kNFE39TSQlvoENk,125
|
|
2
|
-
xcpcio/__version__.py,sha256=
|
|
2
|
+
xcpcio/__version__.py,sha256=bqW3xNfcKZLCjzET76nCOrvRVs1ULNTmgQNmTC__WlI,172
|
|
3
3
|
xcpcio/constants.py,sha256=MjpAgNXiBlUsx1S09m7JNT-nekNDR-aE6ggvGL3fg0I,2297
|
|
4
|
-
xcpcio/types.py,sha256
|
|
4
|
+
xcpcio/types.py,sha256=CLhRp_HaVbK9YK8yNOHDNDIis8XOAo5BWz5lZS-qbvw,7927
|
|
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
|
|
8
8
|
xcpcio/app/clics_archiver.py,sha256=wd7zkbq2oyWfkS09w0f3KBr32F2yCcTMx36H5HFMgRg,7995
|
|
9
9
|
xcpcio/app/clics_server.py,sha256=-zUixNf08yICT2sry23h72ZrEm6NPb30bH5AHCXZlBM,4623
|
|
10
|
-
xcpcio/app/clics_uploader.py,sha256=
|
|
10
|
+
xcpcio/app/clics_uploader.py,sha256=Hw2buDX7lO8kghcxmLLv3P-F4uO73BDBPctmVTb7GEw,3592
|
|
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=eGvPnFkxpCGVl43hoi2_6fBXR3c4jj3Td-R4i9wHt1M,10849
|
|
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
|
|
@@ -42,7 +42,7 @@ xcpcio/clics/model/model_2023_06/model.py,sha256=bVMDWpJTwPSpz1fHPxWrWerxCBIboH3
|
|
|
42
42
|
xcpcio/clics/reader/__init__.py,sha256=Nfi78X8J1tJPh7WeSRPLMRUprlS2JYelYJHW4DfyJ7U,162
|
|
43
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.
|
|
46
|
-
xcpcio-0.
|
|
47
|
-
xcpcio-0.
|
|
48
|
-
xcpcio-0.
|
|
45
|
+
xcpcio-0.74.0.dist-info/METADATA,sha256=OTxJWftLDzlvdKzbx0TAISCLxyxoUs0RcF0a1s5g3js,2237
|
|
46
|
+
xcpcio-0.74.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
47
|
+
xcpcio-0.74.0.dist-info/entry_points.txt,sha256=KxviS5TVXlZ9KqS9UNMx3nI15xhEGvkTq86RaPhUhs4,158
|
|
48
|
+
xcpcio-0.74.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|