kattis-cli 1.1.1__py3-none-any.whl → 1.1.2__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.
kattis_cli/download.py CHANGED
@@ -42,7 +42,7 @@ class DownloadManager:
42
42
 
43
43
  return root_problem_folder
44
44
 
45
- def download_html(self, problemid: str) -> str:
45
+ def download_html(self, problemid: str) -> Any:
46
46
  """Download the problem HTML page for a given problem id.
47
47
 
48
48
  Returns the HTML body as a stripped string when successful or
@@ -167,12 +167,11 @@ class DownloadManager:
167
167
  uri = f'{settings.KATTIS_PROBLEM_URL}{problemid}'
168
168
  uri += '/file/statement/samples.zip'
169
169
 
170
- root_problem_folder = self.create_problem_folder(problemid)
171
-
172
- data_folder = root_problem_folder.joinpath('data')
173
- data_folder.mkdir(exist_ok=True)
174
170
  response = requests.get(uri, allow_redirects=True, timeout=10)
175
171
  if response.status_code == 200:
172
+ root_problem_folder = self.create_problem_folder(problemid)
173
+ data_folder = root_problem_folder.joinpath('data')
174
+ data_folder.mkdir(exist_ok=True)
176
175
  zip_path = data_folder.joinpath('samples.zip')
177
176
  with open(data_folder.joinpath('samples.zip'), 'wb') as f:
178
177
  f.write(response.content)
@@ -197,7 +196,7 @@ def create_problem_folder(problemid: str) -> Path:
197
196
  return _manager.create_problem_folder(problemid)
198
197
 
199
198
 
200
- def download_html(problemid: str) -> str:
199
+ def download_html(problemid: str) -> Any:
201
200
  """Download problem HTML using the module-level manager."""
202
201
 
203
202
  return _manager.download_html(problemid)
kattis_cli/main.py CHANGED
@@ -1,13 +1,13 @@
1
1
  """ Main module for the kattis_cli package.
2
2
  This is the main.py file for the kattis_cli package.
3
3
 
4
- Change the contents here instead of main.py.
4
+ Change the contents in dev.py instead of in main.py.
5
5
  build.sh script copies the contents of this file to main.py.
6
6
 
7
7
  Change the __version__ to match in pyproject.toml
8
8
  Has to be higher than the pypi version.
9
9
  """
10
- __version__ = '1.1.1'
10
+ __version__ = '1.1.2'
11
11
 
12
12
  from math import inf
13
13
  from typing import Tuple
@@ -45,12 +45,11 @@ def get(problemid: str) -> None:
45
45
  download.download_sample_data(problemid)
46
46
  except requests.exceptions.InvalidURL:
47
47
  console.print(
48
- f"""Sample data for Problem ID: [bold blue]
49
- {problemid}[/bold blue] not found.")
50
- """)
51
- console.print(
52
- f"Downloading metadata: [bold blue]{problemid}[/bold blue]")
53
- download.load_problem_metadata(problemid)
48
+ f"Problem ID: [bold red]{problemid}[/bold red] not found.")
49
+ else:
50
+ console.print(
51
+ f"Downloading metadata: [bold blue]{problemid}[/bold blue]")
52
+ download.load_problem_metadata(problemid)
54
53
 
55
54
 
56
55
  @main.command(help='Show problem metadata.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kattis-cli
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: A command-line tool for Kattis
5
5
  License-File: LICENSE
6
6
  Author: Ram Basnet
@@ -1,11 +1,11 @@
1
1
  kattis_cli/.kattis-cli.toml,sha256=kGh0gmpFAnivyUC9hR8Y1ZqYJeTBWNyBQ9zOg4AInZ0,898
2
2
  kattis_cli/__init__.py,sha256=afN92pog2fGyicY6KNBofYbCBYbYj4Fpi_INUSpsc-E,402
3
3
  kattis_cli/client.py,sha256=5ef-pq737q-VBBxY1F-bEbP9Mf8145YppL4m9NlVCVY,16938
4
- kattis_cli/download.py,sha256=IFjebvvxJyPKfsK8Voo06llSsybBqqylUWEv5lF2J7o,8651
4
+ kattis_cli/download.py,sha256=BATQskOUFyc286vDYY7S4nmBWPBrYsgHwCE1VBsltx0,8662
5
5
  kattis_cli/fireworks.py,sha256=yKFXIvDDdNrzBhpEt2Pdy5zgfYjJffoOEf2yUFlu2TQ,4134
6
6
  kattis_cli/kattis.py,sha256=wpnM6sC0a32kJYzEux27izug59bicexNnOFxcx0qWM8,2621
7
7
  kattis_cli/kattis_setup.py,sha256=mic79GjOI_rC6Lfl5D5ORDMWdrcxR71ksYUM51yezu8,5659
8
- kattis_cli/main.py,sha256=NoSSGZdtd3PO3TnAIi5stvTi8Zb_6Ppd9pLKv6CiYKE,4511
8
+ kattis_cli/main.py,sha256=jRANFixHzJdnACp1Mzi5p5wxFrSF6FXFrPxLhn8olSc,4491
9
9
  kattis_cli/settings.py,sha256=d5q4dYj9VqDSqPalleh2oZWtND-1bPB0T2IwdajFrBg,591
10
10
  kattis_cli/solution_tester.py,sha256=hTXtryYs8lkO9CkSPtQNjhrAPPLaC4au5ueCQ3ioZWQ,7577
11
11
  kattis_cli/ui.py,sha256=2qFWz9QB7cgjLfZKHrWUrKFVYLRLwl0c37ZTNljwmAI,4580
@@ -14,8 +14,8 @@ kattis_cli/utils/config.py,sha256=6SIuiXA9sFADo8RZUj8A6rXb3uqmrWrmmArfZrqNQdw,22
14
14
  kattis_cli/utils/languages.py,sha256=gcJJJwkPS1Zpg76atwoo2O2Vd7ETKBQV-KD_cwclrmE,8928
15
15
  kattis_cli/utils/run_program.py,sha256=NWQ6vtTeWgkaW75r91FIHGXR5cAbeu8yMb5hwzpYFsg,2613
16
16
  kattis_cli/utils/utility.py,sha256=oUbydPbcC2wXvfku21YAWpaJjuBKaBRVybMAWCSfM9Y,2987
17
- kattis_cli-1.1.1.dist-info/METADATA,sha256=TLE1BHoCDFfWPj0eKEQG4gk4F0ciOBROwlkG7_FnVcs,6962
18
- kattis_cli-1.1.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
19
- kattis_cli-1.1.1.dist-info/entry_points.txt,sha256=kyzGN20VqUPR_H0J_jJUKT-10-cAMFLVegQ6C7tbHss,47
20
- kattis_cli-1.1.1.dist-info/licenses/LICENSE,sha256=JmBa4SEKBCDWEgiOZcISU4tUCpli6xSpVlSYgkBXSNQ,1067
21
- kattis_cli-1.1.1.dist-info/RECORD,,
17
+ kattis_cli-1.1.2.dist-info/METADATA,sha256=SM1Ah1m_9WvKo-glbw1Xx-BnEwUSFFhxU6oCViGjUxc,6962
18
+ kattis_cli-1.1.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
19
+ kattis_cli-1.1.2.dist-info/entry_points.txt,sha256=kyzGN20VqUPR_H0J_jJUKT-10-cAMFLVegQ6C7tbHss,47
20
+ kattis_cli-1.1.2.dist-info/licenses/LICENSE,sha256=JmBa4SEKBCDWEgiOZcISU4tUCpli6xSpVlSYgkBXSNQ,1067
21
+ kattis_cli-1.1.2.dist-info/RECORD,,