24 |
24 |
25 def read(self, fileNameOrDevice): |
25 def read(self, fileNameOrDevice): |
26 """ |
26 """ |
27 Public method to read a user agent file. |
27 Public method to read a user agent file. |
28 |
28 |
29 @param fileNameOrDevice name of the file to read (string) |
29 @param fileNameOrDevice name of the file to read or reference to the device |
30 or reference to the device to read (QIODevice) |
30 to read |
31 @return dictionary with user agent data (host as key, agent string as |
31 @type str or QIODevice |
32 value) |
32 @return dictionary with user agent data (host as key, agent string as value) |
|
33 @rtype dict |
33 """ |
34 """ |
34 self.__agents = {} |
35 self.__agents = {} |
35 |
36 |
36 if isinstance(fileNameOrDevice, QIODevice): |
37 if isinstance(fileNameOrDevice, QIODevice): |
37 self.setDevice(fileNameOrDevice) |
38 self.setDevice(fileNameOrDevice) |