File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from typing import Optional
12import click
23
34import elkplot
45
56
67@click .group ()
7- def cli ():
8- ...
8+ def cli (): ...
99
1010
1111@cli .command ()
@@ -21,15 +21,25 @@ def home():
2121
2222
2323@cli .command ()
24- def up ():
24+ @click .argument ("height" , type = float , required = False )
25+ def up (height : Optional [float ] = None ):
2526 """Lift the pen off the page"""
26- elkplot .Device ().pen_up ()
27+ if height is not None :
28+ device = elkplot .Device (pen_up_position = height )
29+ else :
30+ device = elkplot .Device ()
31+ device .pen_up ()
2732
2833
2934@cli .command ()
30- def down ():
35+ @click .argument ("height" , type = float , required = False )
36+ def down (height : Optional [float ] = None ):
3137 """Bring the pen down onto the page"""
32- elkplot .Device ().pen_down ()
38+ if height is not None :
39+ device = elkplot .Device (pen_up_position = height )
40+ else :
41+ device = elkplot .Device ()
42+ device .pen_down ()
3343
3444
3545@cli .command ()
You can’t perform that action at this time.
0 commit comments