kattis-cli 1.2.1__py3-none-any.whl → 1.2.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.
@@ -18,5 +18,5 @@ def main() -> None:
18
18
 
19
19
 
20
20
  if __name__ == "__main__":
21
- name()
21
+ main()
22
22
 
kattis_cli/main.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Change the __version__ to match in pyproject.toml
4
4
  """
5
- __version__ = '1.2.1'
5
+ __version__ = '1.2.3'
6
6
 
7
7
  from math import inf
8
8
  import os
@@ -37,25 +37,31 @@ def get(problemid: str) -> None:
37
37
  """
38
38
  console = Console()
39
39
  console.print(
40
- f"Downloading samples: [bold blue]{problemid}[/bold blue]")
40
+ f"Downloading metadata: [bold blue]{problemid}[/bold blue]")
41
41
  try:
42
- download.download_sample_data(problemid)
43
- console.print(
44
- f"Downloading metadata: [bold blue]{problemid}[/bold blue]")
45
42
  download.load_problem_metadata(problemid)
46
43
  except requests.exceptions.InvalidURL:
47
44
  console.print(
48
45
  f"Problem ID: [bold red]{problemid}[/bold red] not found.")
49
46
  else:
50
47
  console.print(
51
- f"Downloaded samples and metadata: \
52
- [bold blue]{problemid}[/bold blue]")
48
+ f"Downloading samples: [bold blue]{problemid}[/bold blue]")
49
+ try:
50
+ download.download_sample_data(problemid)
51
+ except requests.exceptions.InvalidURL:
52
+ console.print(
53
+ f"Problem ID: [bold red]{problemid}[/bold red] metadata \
54
+ not found.")
55
+ else:
56
+ console.print(
57
+ f"Downloaded samples and metadata: \
58
+ [bold blue]{problemid}[/bold blue]")
53
59
 
54
60
 
55
61
  @main.command(help='Show problem metadata.')
56
62
  @click.option('-p', '--problemid', default='', help='Problem ID.')
57
63
  def info(problemid: str) -> None:
58
- """Display problem metada.
64
+ """Display problem metadata.
59
65
  """
60
66
  ui.show_problem_metadata(problemid)
61
67
 
@@ -154,7 +154,7 @@ def guess_mainfile(
154
154
  str: main file
155
155
  """
156
156
  if len(files) == 1:
157
- return files[0]
157
+ return Path(files[0]).name
158
158
  # check .kattis-cli.toml file
159
159
  if 'mainfile' in lang_config:
160
160
  return lang_config['mainfile'].replace(('{problemid}'), problemid)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kattis-cli
3
- Version: 1.2.1
3
+ Version: 1.2.3
4
4
  Summary: A command-line tool for Kattis
5
5
  License-File: LICENSE
6
6
  Author: Ram Basnet
@@ -95,12 +95,16 @@ python -m pip install kattis-cli --upgrade
95
95
  ## Kattis configuration
96
96
 
97
97
  - run the following command and enter your Kattis credentials
98
- - this will create a .kattisrc file in your home directory
98
+ - follow the instructions provided in the terminal
99
99
 
100
100
  ```bash
101
101
  kattis setup
102
102
  ```
103
103
 
104
+ ## Manual Configuration
105
+
106
+ - see [SETUP.md](./SETUP.md) for detailed instructions to setup kattis-cli
107
+
104
108
  ## Usage
105
109
 
106
110
  ```bash
@@ -10,7 +10,7 @@ kattis_cli/kattis_templates/main/c.txt,sha256=HIJF1XMi40XbaC63o7kqfInvK_WvO6pPkS
10
10
  kattis_cli/kattis_templates/main/cpp.txt,sha256=TmVm0vX1YZyzG3P0p2doix-47bofS0xiZeKiPbmNcWM,214
11
11
  kattis_cli/kattis_templates/main/java.txt,sha256=4-485QJ0sV1RczRV-VxKYc6El2xD16y2oUAUEQpu9Fg,309
12
12
  kattis_cli/kattis_templates/main/python.txt,sha256=RTDUEN2sSp6u1NuI1j371hgii3ouRfnfXI2Yb55D2zM,327
13
- kattis_cli/kattis_templates/main/python3.txt,sha256=bYcDVlq0cGhjVF1wXHlrN42cQkMD47qmmogzMfCpXtY,331
13
+ kattis_cli/kattis_templates/main/python3.txt,sha256=FcbUc1AZGAOtn95lyj6yAzrtls9N94ipg7w_ouK0Y5w,331
14
14
  kattis_cli/kattis_templates/project_structure/c/Makefile,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  kattis_cli/kattis_templates/project_structure/c/src/problemid/problemid.c,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  kattis_cli/kattis_templates/project_structure/c/tests/test_problemid.c,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -27,18 +27,18 @@ kattis_cli/kattis_templates/project_structure/python3/Makefile,sha256=47DEQpj8HB
27
27
  kattis_cli/kattis_templates/project_structure/python3/src/problemid.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  kattis_cli/kattis_templates/project_structure/python3/tests/__init__.py,sha256=AMhJu7wP66tZlvKEDwSrdDdQDQ6ZmMQFWjKTPjCPNAg,114
29
29
  kattis_cli/kattis_templates/project_structure/python3/tests/test_problemid.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- kattis_cli/main.py,sha256=SXhNe3kXdeJt-2bbL6NTnoN135AIAqinigpyKEYrQcc,4996
30
+ kattis_cli/main.py,sha256=XBLNMsCTFSkzBdpmjKSJb9nctKP0IxweYIstKnQ8kCI,5222
31
31
  kattis_cli/settings.py,sha256=d5q4dYj9VqDSqPalleh2oZWtND-1bPB0T2IwdajFrBg,591
32
32
  kattis_cli/solution_tester.py,sha256=SQUq1Da06-_b9tTi0-CiTogscWje1Ur7KuaiK1Bxsgs,7860
33
33
  kattis_cli/template.py,sha256=63KdxOnDcv7vFFD11zVDvdc_2vKJB_MT5ynI9_jc0Tg,5421
34
34
  kattis_cli/ui.py,sha256=2qFWz9QB7cgjLfZKHrWUrKFVYLRLwl0c37ZTNljwmAI,4580
35
35
  kattis_cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  kattis_cli/utils/config.py,sha256=sR6lbRl9KiXRKIV1zRP5s6KJ9jed0znilsHSBS-_G2k,2278
37
- kattis_cli/utils/languages.py,sha256=GQjos4VKkyEBySPaOK1SFsWTqIIWdld0O_VHG-YEgi4,8977
37
+ kattis_cli/utils/languages.py,sha256=6Oc1RgYs7CWFzMO_VzahG3J0vixz40hlnxx3pFP2T24,8988
38
38
  kattis_cli/utils/run_program.py,sha256=NWQ6vtTeWgkaW75r91FIHGXR5cAbeu8yMb5hwzpYFsg,2613
39
39
  kattis_cli/utils/utility.py,sha256=oUbydPbcC2wXvfku21YAWpaJjuBKaBRVybMAWCSfM9Y,2987
40
- kattis_cli-1.2.1.dist-info/METADATA,sha256=mWCMaDJbeTpCUWQnCW3MtkPoupsbKp58_WS5dQ1No2A,7206
41
- kattis_cli-1.2.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
42
- kattis_cli-1.2.1.dist-info/entry_points.txt,sha256=kyzGN20VqUPR_H0J_jJUKT-10-cAMFLVegQ6C7tbHss,47
43
- kattis_cli-1.2.1.dist-info/licenses/LICENSE,sha256=JmBa4SEKBCDWEgiOZcISU4tUCpli6xSpVlSYgkBXSNQ,1067
44
- kattis_cli-1.2.1.dist-info/RECORD,,
40
+ kattis_cli-1.2.3.dist-info/METADATA,sha256=WmJJNH7rpuPMZRRreVwKOawGU1EiYmt42cuwBwm-nZE,7299
41
+ kattis_cli-1.2.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
42
+ kattis_cli-1.2.3.dist-info/entry_points.txt,sha256=kyzGN20VqUPR_H0J_jJUKT-10-cAMFLVegQ6C7tbHss,47
43
+ kattis_cli-1.2.3.dist-info/licenses/LICENSE,sha256=JmBa4SEKBCDWEgiOZcISU4tUCpli6xSpVlSYgkBXSNQ,1067
44
+ kattis_cli-1.2.3.dist-info/RECORD,,