4745:285bfd224a1b | 4749:750577d35452 |
---|---|
7 Module implementing a data structure for login forms. | 7 Module implementing a data structure for login forms. |
8 """ | 8 """ |
9 | 9 |
10 from __future__ import unicode_literals | 10 from __future__ import unicode_literals |
11 | 11 |
12 from PyQt5.QtCore import QUrl, QByteArray | 12 from PyQt5.QtCore import QUrl |
13 | 13 |
14 | 14 |
15 class LoginForm(object): | 15 class LoginForm(object): |
16 """ | 16 """ |
17 Class implementing a data structure for login forms. | 17 Class implementing a data structure for login forms. |
20 """ | 20 """ |
21 Constructor | 21 Constructor |
22 """ | 22 """ |
23 self.url = QUrl() | 23 self.url = QUrl() |
24 self.name = "" | 24 self.name = "" |
25 self.postData = QByteArray() | 25 self.postData = "" |
26 | 26 |
27 def isValid(self): | 27 def isValid(self): |
28 """ | 28 """ |
29 Public method to test for validity. | 29 Public method to test for validity. |
30 | 30 |
31 @return flag indicating a valid form (boolean) | 31 @return flag indicating a valid form (boolean) |
32 """ | 32 """ |
33 return not self.url.isEmpty() and \ | 33 return not self.url.isEmpty() and \ |
34 not self.postData.isEmpty() | 34 bool(self.postData) |