Skip to content

Commit 9a6da0a

Browse files
committed
Fix display for detail
1 parent cd1d303 commit 9a6da0a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

term_timer/magic_cube.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from cubing_algs.algorithm import Algorithm
12
from cubing_algs.display import VCubeDisplay
23
from magiccube.cube import Cube as BaseCube
34

@@ -33,17 +34,20 @@ def rotate(self, movements) -> None:
3334
super().rotate(str(movements))
3435

3536
@property
36-
def state(self):
37+
def state(self) -> str:
3738
return self.get_kociemba_facelet_positions()
3839

39-
def __str__(self) -> str:
40-
if CUBE_ORIENTATION_MOVES:
41-
self.rotate(str(CUBE_ORIENTATION_MOVES))
40+
def display(self, orientation: Algorithm = None) -> str:
41+
if orientation:
42+
self.rotate(orientation)
4243

4344
display = VCubeDisplay(self).display()
4445

45-
if CUBE_ORIENTATION_MOVES:
46-
for _ in CUBE_ORIENTATION_MOVES:
46+
if orientation:
47+
for _ in orientation:
4748
self.undo()
4849

4950
return display
51+
52+
def __str__(self) -> str:
53+
return self.display(CUBE_ORIENTATION_MOVES)

term_timer/stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def detail(self, solve_id: int, method: str,
580580
cube = Cube(self.cube_size)
581581
cube.rotate(solve.scramble)
582582

583-
console.print(str(cube), end='')
583+
console.print(cube.display(), end='')
584584

585585
if solve.advanced:
586586
if show_reconstruction:

0 commit comments

Comments
 (0)