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:
9930
9930
9931
9931
return mapping .from_maybe_impl (self ._impl_obj .stop ())
9932
9932
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
+
9933
9942
9934
9943
mapping .register (PlaywrightImpl , Playwright )
9935
9944
Original file line number Diff line number Diff line change @@ -9872,6 +9872,15 @@ def stop(self) -> NoneType:
9872
9872
9873
9873
return mapping .from_maybe_impl (self ._impl_obj .stop ())
9874
9874
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
+
9875
9884
9876
9885
mapping .register (PlaywrightImpl , Playwright )
9877
9886
Original file line number Diff line number Diff line change @@ -115,7 +115,19 @@ def generate(t: Any) -> None:
115
115
f"""
116
116
return { prefix } { arguments (value , len (prefix ))} { suffix } """
117
117
)
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
+ )
119
131
print ("" )
120
132
print (f"mapping.register({ class_name } Impl, { class_name } )" )
121
133
Original file line number Diff line number Diff line change @@ -114,7 +114,19 @@ def generate(t: Any) -> None:
114
114
f"""
115
115
return { prefix } { arguments (value , len (prefix ))} { suffix } """
116
116
)
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
+ )
118
130
print ("" )
119
131
print (f"mapping.register({ class_name } Impl, { class_name } )" )
120
132
You can’t perform that action at this time.
0 commit comments