@@ -19,41 +19,18 @@ def data(self):
19
19
@property
20
20
def not_created (self ):
21
21
# Return a list of names of viewers that have not been created yet
22
- names = []
23
- for key , val in self .data .items ():
24
- name = val ['name' ]
25
- if not val ['status' ]:
26
- name = name if name is not None else key
27
- names .append (name )
28
- return names
22
+ return [k for k in self .data .keys () if not self .viewer_ready (k )]
29
23
30
- @property
31
- def not_named (self ):
32
- # Return a list of names of viewers that have not been named yet
33
- return any ([k for k , v in self .data .items () if v ['name' ] is None ])
34
-
35
- @property
36
- def viewer_objects (self ):
37
- # Return a list of created viewers
38
- return list (self .data .keys ())
39
-
40
- def add_viewer (self , view ):
41
- self .data [view ] = {'name' : None , 'status' : False }
42
-
43
- def set_name (self , view , name ):
44
- if view not in self .data .keys ():
45
- self .add_viewer (view )
46
- self .data [view ]['name' ] = name
24
+ def add_viewer (self , view : str ) -> None :
25
+ self .data [view ] = {"ready" : False }
47
26
48
27
def update_viewer_status (self , view , status ):
49
28
if view not in self .data .keys ():
50
29
self .add_viewer (view )
51
- self .data [view ]['status' ] = status
30
+ self .data [view ]["ready" ] = status
52
31
53
- def viewer_ready (self , view ):
54
- if viewer := self .data .get (view ):
55
- return viewer ['status' ]
56
- return False
32
+ def viewer_ready (self , view : str ) -> bool :
33
+ return self .data .get (view , {}).get ("ready" , False )
57
34
58
35
59
36
class CellWatcher (object ):
0 commit comments