Helpviewer/AdBlock/AdBlockSubscription.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 956
f3e1500da1df
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
17 from .AdBlockRule import AdBlockRule 17 from .AdBlockRule import AdBlockRule
18 18
19 import Helpviewer.HelpWindow 19 import Helpviewer.HelpWindow
20 20
21 import Utilities 21 import Utilities
22
22 23
23 class AdBlockSubscription(QObject): 24 class AdBlockSubscription(QObject):
24 """ 25 """
25 Class implementing the AdBlock subscription. 26 Class implementing the AdBlock subscription.
26 27
28 @signal rulesChanged() emitted after the subscription's rules have changed 29 @signal rulesChanged() emitted after the subscription's rules have changed
29 """ 30 """
30 changed = pyqtSignal() 31 changed = pyqtSignal()
31 rulesChanged = pyqtSignal() 32 rulesChanged = pyqtSignal()
32 33
33 def __init__(self, url, parent = None): 34 def __init__(self, url, parent=None):
34 """ 35 """
35 Constructor 36 Constructor
36 37
37 @param url AdBlock URL for the subscription (QUrl) 38 @param url AdBlock URL for the subscription (QUrl)
38 @param parent reference to the parent object (QObject) 39 @param parent reference to the parent object (QObject)
94 queryItems.append(("location", bytes(self.__location).decode())) 95 queryItems.append(("location", bytes(self.__location).decode()))
95 queryItems.append(("title", self.__title)) 96 queryItems.append(("title", self.__title))
96 if not self.__enabled: 97 if not self.__enabled:
97 queryItems.append(("enabled", "false")) 98 queryItems.append(("enabled", "false"))
98 if self.__lastUpdate.isValid(): 99 if self.__lastUpdate.isValid():
99 queryItems.append(("lastUpdate", 100 queryItems.append(("lastUpdate",
100 self.__lastUpdate.toString(Qt.ISODate))) 101 self.__lastUpdate.toString(Qt.ISODate)))
101 url.setQueryItems(queryItems) 102 url.setQueryItems(queryItems)
102 return url 103 return url
103 104
104 def isEnabled(self): 105 def isEnabled(self):

eric ide

mercurial