File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ """Selenium type definitions."""
19
+
20
+ from typing import Union
21
+
22
+
23
+ AnyKey = Union [str , int , float ]
Original file line number Diff line number Diff line change 22
22
from typing import Iterable , List , Optional , Union
23
23
24
24
import socket
25
+ from selenium .types import AnyKey
25
26
from selenium .webdriver .common .keys import Keys
26
27
27
- AnyKey = Union [str , int , float ]
28
28
29
29
_is_connectable_exceptions = (socket .error , ConnectionResetError )
30
30
Original file line number Diff line number Diff line change 18
18
from abc import ABCMeta , abstractmethod
19
19
import os
20
20
from typing import Optional
21
+ from selenium .types import AnyKey
21
22
from selenium .webdriver .common .utils import keys_to_typing
22
- # from selenium.types import AnyKey
23
23
24
24
25
25
class FileDetector (metaclass = ABCMeta ):
@@ -29,7 +29,7 @@ class FileDetector(metaclass=ABCMeta):
29
29
"""
30
30
31
31
@abstractmethod
32
- def is_local_file (self , * keys ) -> Optional [str ]:
32
+ def is_local_file (self , * keys : AnyKey ) -> Optional [str ]:
33
33
return None
34
34
35
35
@@ -38,7 +38,7 @@ class UselessFileDetector(FileDetector):
38
38
A file detector that never finds anything.
39
39
"""
40
40
41
- def is_local_file (self , * keys ) -> Optional [str ]:
41
+ def is_local_file (self , * keys : AnyKey ) -> Optional [str ]:
42
42
return None
43
43
44
44
@@ -47,7 +47,7 @@ class LocalFileDetector(FileDetector):
47
47
Detects files on the local disk.
48
48
"""
49
49
50
- def is_local_file (self , * keys ) -> Optional [str ]:
50
+ def is_local_file (self , * keys : AnyKey ) -> Optional [str ]:
51
51
file_path = '' .join (keys_to_typing (keys ))
52
52
53
53
if not file_path :
You can’t perform that action at this time.
0 commit comments