File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -9930,6 +9930,15 @@ def stop(self) -> NoneType:
99309930
99319931 return mapping .from_maybe_impl (self ._impl_obj .stop ())
99329932
9933+ def __getitem__ (self , value : str ) -> "BrowserType" :
9934+ if value == "chromium" :
9935+ return self .chromium
9936+ elif value == "firefox" :
9937+ return self .firefox
9938+ elif value == "webkit" :
9939+ return self .webkit
9940+ raise ValueError ("Invalid browser " + value )
9941+
99339942
99349943mapping .register (PlaywrightImpl , Playwright )
99359944
Original file line number Diff line number Diff line change @@ -9872,6 +9872,15 @@ def stop(self) -> NoneType:
98729872
98739873 return mapping .from_maybe_impl (self ._impl_obj .stop ())
98749874
9875+ def __getitem__ (self , value : str ) -> "BrowserType" :
9876+ if value == "chromium" :
9877+ return self .chromium
9878+ elif value == "firefox" :
9879+ return self .firefox
9880+ elif value == "webkit" :
9881+ return self .webkit
9882+ raise ValueError ("Invalid browser " + value )
9883+
98759884
98769885mapping .register (PlaywrightImpl , Playwright )
98779886
Original file line number Diff line number Diff line change @@ -115,7 +115,19 @@ def generate(t: Any) -> None:
115115 f"""
116116 return { prefix } { arguments (value , len (prefix ))} { suffix } """
117117 )
118-
118+ if class_name == "Playwright" :
119+ print (
120+ """
121+ def __getitem__(self, value: str) -> "BrowserType":
122+ if value == "chromium":
123+ return self.chromium
124+ elif value == "firefox":
125+ return self.firefox
126+ elif value == "webkit":
127+ return self.webkit
128+ raise ValueError("Invalid browser "+value)
129+ """
130+ )
119131 print ("" )
120132 print (f"mapping.register({ class_name } Impl, { class_name } )" )
121133
Original file line number Diff line number Diff line change @@ -114,7 +114,19 @@ def generate(t: Any) -> None:
114114 f"""
115115 return { prefix } { arguments (value , len (prefix ))} { suffix } """
116116 )
117-
117+ if class_name == "Playwright" :
118+ print (
119+ """
120+ def __getitem__(self, value: str) -> "BrowserType":
121+ if value == "chromium":
122+ return self.chromium
123+ elif value == "firefox":
124+ return self.firefox
125+ elif value == "webkit":
126+ return self.webkit
127+ raise ValueError("Invalid browser "+value)
128+ """
129+ )
118130 print ("" )
119131 print (f"mapping.register({ class_name } Impl, { class_name } )" )
120132
You can’t perform that action at this time.
0 commit comments