cube-cli 0.4.1__tar.gz → 0.4.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cube-cli
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A CLI application for the 3x3x3 cube
5
5
  Requires-Python: >=3.13,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -19,43 +19,64 @@ puzzles based on it.
19
19
 
20
20
  cube [options] [file]
21
21
 
22
- [file] is a saved cube from a previous session. If not specified,
22
+ `[file]` is a saved cube from a previous session. If not specified,
23
23
  the cube is initialized to its solved state.
24
24
 
25
25
  ## Options
26
26
 
27
- --help
28
- --version
27
+ `--help`
28
+
29
+ `--version`
29
30
 
30
31
  ## Commands
31
32
 
32
33
  Before you enter a command, the current state of the cube is printed
33
34
  in a textual format.
34
35
 
35
- \<moves> A sequence of moves in standard cube move syntax.
36
+ **\<moves>**
37
+
38
+ A sequence of moves in standard cube move syntax.
36
39
  Case-insensitive. To specify a wide move, use a 'w' suffix.
37
40
 
38
- ^\<moves> A sequence of moves in standard cube move syntax.
41
+ **^\<moves>**
42
+
43
+ A sequence of moves in standard cube move syntax.
39
44
  Case-sensitive. To specify a wide move, use either a lower-case face
40
45
  letter or a 'w' suffix.
41
46
 
42
- solve Return the cube to its initial solved position.
47
+ **solve**
48
+
49
+ Return the cube to its initial solved position.
50
+
51
+ **shuffle**
52
+
53
+ Randomize the position of the cube.
43
54
 
44
- shuffle Randomize the position of the cube.
55
+ **undo**
45
56
 
46
- undo Undo the last previous command.
57
+ Undo the last previous command.
47
58
 
48
- redo If the last previous command was an undo, reverse its effect.
59
+ **redo**
49
60
 
50
- save [file] Save the cube to a file. If [file] is not specified, save
61
+ If the last previous command was an undo, reverse its effect.
62
+
63
+ **save [file]**
64
+
65
+ Save the cube to a file. If `[file]` is not specified, save
51
66
  to the last file used for a load or save, or to cube.json in the
52
67
  current directory.
53
68
 
54
- load [file] Load a saved cube. If [file] is not specified, load from
69
+ **load [file]**
70
+
71
+ Load a saved cube. If `[file]` is not specified, load from
55
72
  the last file used for a load or save, or to cube.json in the
56
73
  current directory.
57
74
 
58
- help, ? Print this command reference.
75
+ **help, ?**
76
+
77
+ Print this command reference.
78
+
79
+ **quit, q**
59
80
 
60
- quit, q Exit cube.
81
+ Exit cube.
61
82
 
@@ -0,0 +1,69 @@
1
+ # cube-cli
2
+
3
+ A textual cli environment for manipulating a 3x3x3 cube and solving
4
+ puzzles based on it.
5
+
6
+ ## Usage
7
+
8
+ cube [options] [file]
9
+
10
+ `[file]` is a saved cube from a previous session. If not specified,
11
+ the cube is initialized to its solved state.
12
+
13
+ ## Options
14
+
15
+ `--help`
16
+
17
+ `--version`
18
+
19
+ ## Commands
20
+
21
+ Before you enter a command, the current state of the cube is printed
22
+ in a textual format.
23
+
24
+ **\<moves>**
25
+
26
+ A sequence of moves in standard cube move syntax.
27
+ Case-insensitive. To specify a wide move, use a 'w' suffix.
28
+
29
+ **^\<moves>**
30
+
31
+ A sequence of moves in standard cube move syntax.
32
+ Case-sensitive. To specify a wide move, use either a lower-case face
33
+ letter or a 'w' suffix.
34
+
35
+ **solve**
36
+
37
+ Return the cube to its initial solved position.
38
+
39
+ **shuffle**
40
+
41
+ Randomize the position of the cube.
42
+
43
+ **undo**
44
+
45
+ Undo the last previous command.
46
+
47
+ **redo**
48
+
49
+ If the last previous command was an undo, reverse its effect.
50
+
51
+ **save [file]**
52
+
53
+ Save the cube to a file. If `[file]` is not specified, save
54
+ to the last file used for a load or save, or to cube.json in the
55
+ current directory.
56
+
57
+ **load [file]**
58
+
59
+ Load a saved cube. If `[file]` is not specified, load from
60
+ the last file used for a load or save, or to cube.json in the
61
+ current directory.
62
+
63
+ **help, ?**
64
+
65
+ Print this command reference.
66
+
67
+ **quit, q**
68
+
69
+ Exit cube.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cube-cli"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  description = "A CLI application for the 3x3x3 cube"
5
5
  authors = []
6
6
  readme = "README.md"
@@ -2,27 +2,24 @@
2
2
  import readline
3
3
 
4
4
  from cube_model import Cube, solved
5
+ from typing import cast
5
6
 
6
7
  from .command import Command, Quit, Tabbable, all_commands
7
8
  from .print import print_cube
8
9
  from .repl_state import Alias, Exit, LoadError, ReplState
9
10
  from .save_load import SaveError, load
10
11
 
11
- # All tab completion candidates
12
+ # All tab completion candidates.
13
+ # Use cast to work around mypy bug.
12
14
  _COMPLETIONS: list[str] = sorted(a.name
13
15
  for c in all_commands if issubclass(c, Tabbable)
14
- for a in c.aliases)
16
+ for a in cast(Tabbable, c).aliases)
15
17
 
16
18
  # Do not tab complete if it might be a Move.
17
- # Avoid comprehension due to mypy bug.
18
- _NON_COMPLETIONS: set[str] = set()
19
- cmd: type[Command]
20
- alias: Alias
21
- for cmd in all_commands:
22
- if issubclass(cmd, Tabbable):
23
- for alias in cmd.aliases:
24
- if alias.min_chars > 1:
25
- _NON_COMPLETIONS.add(alias.name[:alias.min_chars - 1])
19
+ # Use cast to work around mypy bug.
20
+ _NON_COMPLETIONS: set[str] = {a.name[:a.min_chars - 1]
21
+ for c in all_commands if issubclass(c, Tabbable)
22
+ for a in cast(Tabbable, c).aliases if a.min_chars > 1}
26
23
 
27
24
  # Cached tab completion candidates for a specific input text
28
25
  _matches: list[str] = []
@@ -22,7 +22,7 @@ def save(cube: Cube, filename: str) -> SaveError | None:
22
22
  cj['version'] = get_version()
23
23
  try:
24
24
  with open(filename, 'w') as f:
25
- json.dump(cj, f)
25
+ json.dump(cj, f, separators=(',',':'))
26
26
  except PermissionError:
27
27
  return SaveError('permission denied')
28
28
  except OSError:
cube_cli-0.4.1/README.md DELETED
@@ -1,48 +0,0 @@
1
- # cube-cli
2
-
3
- A textual cli environment for manipulating a 3x3x3 cube and solving
4
- puzzles based on it.
5
-
6
- ## Usage
7
-
8
- cube [options] [file]
9
-
10
- [file] is a saved cube from a previous session. If not specified,
11
- the cube is initialized to its solved state.
12
-
13
- ## Options
14
-
15
- --help
16
- --version
17
-
18
- ## Commands
19
-
20
- Before you enter a command, the current state of the cube is printed
21
- in a textual format.
22
-
23
- \<moves> A sequence of moves in standard cube move syntax.
24
- Case-insensitive. To specify a wide move, use a 'w' suffix.
25
-
26
- ^\<moves> A sequence of moves in standard cube move syntax.
27
- Case-sensitive. To specify a wide move, use either a lower-case face
28
- letter or a 'w' suffix.
29
-
30
- solve Return the cube to its initial solved position.
31
-
32
- shuffle Randomize the position of the cube.
33
-
34
- undo Undo the last previous command.
35
-
36
- redo If the last previous command was an undo, reverse its effect.
37
-
38
- save [file] Save the cube to a file. If [file] is not specified, save
39
- to the last file used for a load or save, or to cube.json in the
40
- current directory.
41
-
42
- load [file] Load a saved cube. If [file] is not specified, load from
43
- the last file used for a load or save, or to cube.json in the
44
- current directory.
45
-
46
- help, ? Print this command reference.
47
-
48
- quit, q Exit cube.
File without changes
File without changes