rbx.cp 0.5.7__py3-none-any.whl → 0.5.10__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.
rbx/box/contest/main.py CHANGED
@@ -128,7 +128,8 @@ def edit():
128
128
 
129
129
  @app.command('add, a', help='Add new problem to contest.')
130
130
  @within_contest
131
- def add(name: str, short_name: str, preset: Optional[str] = None):
131
+ def add(path: str, short_name: str, preset: Optional[str] = None):
132
+ name = pathlib.Path(path).stem
132
133
  utils.validate_field(ContestProblem, 'short_name', short_name)
133
134
  utils.validate_field(Package, 'name', name)
134
135
 
@@ -141,21 +142,21 @@ def add(name: str, short_name: str, preset: Optional[str] = None):
141
142
  preset_lock = presets.get_preset_lock()
142
143
  if preset is None and preset_lock is not None:
143
144
  preset = preset_lock.preset_name
144
- creation.create(name, preset=preset, path=pathlib.Path(name))
145
+ creation.create(name, preset=preset, path=pathlib.Path(path))
145
146
 
146
147
  contest = find_contest_package_or_die()
147
148
  # Reassign mutable object before saving.
148
149
  contest.problems = sorted(
149
150
  [
150
151
  *contest.problems,
151
- ContestProblem(short_name=short_name, path=pathlib.Path(name)),
152
+ ContestProblem(short_name=short_name, path=pathlib.Path(path)),
152
153
  ],
153
154
  key=lambda p: p.short_name,
154
155
  )
155
156
 
156
157
  save_contest(contest)
157
158
  console.console.print(
158
- f'Problem [item]{name} ({short_name})[/item] added to contest.'
159
+ f'Problem [item]{name} ({short_name})[/item] added to contest at [item]{path}[/item].'
159
160
  )
160
161
 
161
162
 
rbx/box/creation.py CHANGED
@@ -61,6 +61,7 @@ def create(
61
61
  )
62
62
  raise typer.Exit(1)
63
63
 
64
+ dest_path.parent.mkdir(parents=True, exist_ok=True)
64
65
  shutil.copytree(str(problem_path), str(dest_path))
65
66
 
66
67
  # Remove a few left overs.
@@ -334,6 +334,8 @@ def _install(root: pathlib.Path = pathlib.Path(), force: bool = False):
334
334
  shutil.copytree(str(root), str(installation_path))
335
335
  shutil.rmtree(str(installation_path / 'build'), ignore_errors=True)
336
336
  shutil.rmtree(str(installation_path / '.box'), ignore_errors=True)
337
+ shutil.rmtree(str(installation_path / '.local.rbx'), ignore_errors=True)
338
+ shutil.rmtree(str(installation_path / '.git'), ignore_errors=True)
337
339
 
338
340
 
339
341
  def install_from_remote(fetch_info: PresetFetchInfo, force: bool = False) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rbx.cp
3
- Version: 0.5.7
3
+ Version: 0.5.10
4
4
  Summary:
5
5
  Author: Roberto Sales
6
6
  Requires-Python: >=3.9,<4.0
@@ -12,10 +12,10 @@ rbx/box/contest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  rbx/box/contest/build_contest_statements.py,sha256=qar6h5u1xAlOKHl3P7-A1d0aYtaqu4PspGw_DYUGOLY,11260
13
13
  rbx/box/contest/contest_package.py,sha256=-eHk6CfJ083jZptWCjR0F4x_r9qsmKeSOUvK0QnDyA4,2393
14
14
  rbx/box/contest/contest_utils.py,sha256=vWv4iNWdJT5motAznfdNzl8o-tEoCU4xmdyaPTPJZuY,490
15
- rbx/box/contest/main.py,sha256=ZHEVE01dFI_pbT51zvJfQJrUV0cCVQrhbkkeXKN98Cg,6113
15
+ rbx/box/contest/main.py,sha256=BKq_n60BstfSHakvNDUP9lu5LNptx38EN8fYPduS8pU,6171
16
16
  rbx/box/contest/schema.py,sha256=rxzjJasMWPKKhvSJs4eW4A2oCiA4gXgfF-MzqsbPslQ,4914
17
17
  rbx/box/contest/statements.py,sha256=iG_E4bqhc7hof4LlAliw4m9VO8HcDzvnhsWmxzVRQM4,2690
18
- rbx/box/creation.py,sha256=mZ7kEt1F-0scwDBc6oWsJxFRW69AccZlKuJfN1QyDd4,2203
18
+ rbx/box/creation.py,sha256=mVHVVj8ozX9D5qpkLewE5WSjF6HtTm74Pkwubk-bATg,2259
19
19
  rbx/box/download.py,sha256=MFP-R26JiYGAP89I0TK-0fYc69Fsd20tsBqgtRCy5AE,2234
20
20
  rbx/box/environment.py,sha256=i-IGHDyFDaYF1fyr0QHdGZ3z4NWp5sj6nxsbnxhAYq4,10924
21
21
  rbx/box/extensions.py,sha256=p0iLaU28KswOBDX2HGVO_dR2gk-JSAWb6sXC6GZ1d0w,738
@@ -31,7 +31,7 @@ rbx/box/packaging/packager.py,sha256=suCT_SLnWa915rV2j8VFqzH43HGKRTr9mGGlrvj45aw
31
31
  rbx/box/packaging/polygon/packager.py,sha256=CcjHzDr4MwSyp270gsPY6RWoz8bUJeykDqXPvQ3XZ1U,10773
32
32
  rbx/box/packaging/polygon/test.py,sha256=bgEju5PwudgyfwxXJagm8fM6CJVlWM6l_-2q1V-oKaQ,3069
33
33
  rbx/box/packaging/polygon/xml_schema.py,sha256=-r24bCeRMGLrGGoT9FIgmqr87xHL-JzrFaR6bztbYtw,2703
34
- rbx/box/presets/__init__.py,sha256=bDmaBWnwh71lkn2pfGIREN-xlo3HpMZBN9ucodbxscc,16573
34
+ rbx/box/presets/__init__.py,sha256=6IHzqczfiuCdvuXWInimYd9sVMYUQR12BlFaxdr39hI,16721
35
35
  rbx/box/presets/fetch.py,sha256=F-BCOlvEBEyDqtOhiDuGPn4EDtA4Bwm-fqHJ7zZGlW8,1975
36
36
  rbx/box/presets/lock_schema.py,sha256=6sRPnyePOC8yy-5WcD5JRZdDJHf8loqbvpQ1IPiOU9s,349
37
37
  rbx/box/presets/schema.py,sha256=mZmSPkQsw7eQM0lQN6er1MO_LiW1ObwwAZFDK0F5fxE,1962
@@ -157,8 +157,8 @@ rbx/testdata/caching/executable.py,sha256=WKRHNf_fprFJd1Fq1ubmQtR3mZzTYVNwKPLWuZ
157
157
  rbx/testdata/compatible,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
158
158
  rbx/testing_utils.py,sha256=ZZLKMUHlZ4HwsuNY50jqSBJ9HhpnFdba7opjDsvXE1U,2084
159
159
  rbx/utils.py,sha256=wy8zQRb97n3lptilK7UxM4A44KjXb1W5Z1tD61a-K4A,4173
160
- rbx_cp-0.5.7.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
161
- rbx_cp-0.5.7.dist-info/METADATA,sha256=-j1iPGuYhzb9fm2bthZyUdUQkmeFfaVKggfw3-oMPs4,3253
162
- rbx_cp-0.5.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
163
- rbx_cp-0.5.7.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
164
- rbx_cp-0.5.7.dist-info/RECORD,,
160
+ rbx_cp-0.5.10.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
161
+ rbx_cp-0.5.10.dist-info/METADATA,sha256=EsmHzzZh735ZXDIbNXrfLlLmEEriG31WpBP7CcWjats,3254
162
+ rbx_cp-0.5.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
163
+ rbx_cp-0.5.10.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
164
+ rbx_cp-0.5.10.dist-info/RECORD,,