@@ -58,14 +58,12 @@ class Pane:
5858
5959 def __enter__ (self ):
6060 self ._token = self .conn .request ("pane" , self .name , "create" , color = self .color )
61+ return self
6162
6263 def __exit__ (self , exc_type , exc_val , exc_traceback ):
6364 assert self ._token is not None
6465 self .conn .request ("pane" , self .name , auth = self ._token , method = "DELETE" )
6566
66- # TODO: copy_rect, bezier2 methods.
67- # Also, a testing environment in which I port forward into
68- # ttds.tali.network or the like.
6967 def rect (self , x : int , y : int , w : int , h : int , color : Color ):
7068 self ._draw ("rect" , x = x , y = y , w = w , h = h , color = color )
7169
@@ -75,6 +73,12 @@ def circle(self, x: int, y: int, r: int, color: Color):
7573 def line (self , x : int , y : int , x2 : int , y2 : int , color : Color ):
7674 self ._draw ("line" , x = x , y = y , x2 = x2 , y2 = y2 , color = color )
7775
76+ def copy_rect (self , x : int , y : int , w : int , h : int , x2 : int , y2 : int ):
77+ self ._draw ("copy_rect" , x = x , y = y , w = w , h = h , x2 = x2 , y2 = y2 )
78+
79+ def bezier2 (self , x0 , y0 , x1 , y1 , x2 , y2 , color : Color ):
80+ self ._draw ("bezier2" , x0 = x0 , y0 = y0 , x1 = x1 , y1 = y1 , x2 = x2 , y2 = y2 , color = color )
81+
7882 def _draw (self , shape , ** kwargs ):
7983 assert self ._token is not None
8084 self .conn .request ("pane" , self .name , shape , auth = self ._token , ** kwargs )
0 commit comments