53 |
53 |
54 class AdBlockRule(object): |
54 class AdBlockRule(object): |
55 """ |
55 """ |
56 Class implementing the AdBlock rule. |
56 Class implementing the AdBlock rule. |
57 """ |
57 """ |
58 def __init__(self, filter="", subscription=None): |
58 def __init__(self, filterRule="", subscription=None): |
59 """ |
59 """ |
60 Constructor |
60 Constructor |
61 |
61 |
62 @param filter filter string of the rule (string) |
62 @param filterRule filter string of the rule (string) |
63 @param subscription reference to the subscription object |
63 @param subscription reference to the subscription object |
64 (AdBlockSubscription) |
64 (AdBlockSubscription) |
65 """ |
65 """ |
66 self.__subscription = subscription |
66 self.__subscription = subscription |
67 |
67 |
88 self.__xmlhttprequestException = False |
88 self.__xmlhttprequestException = False |
89 self.__document = False |
89 self.__document = False |
90 self.__elemhide = False |
90 self.__elemhide = False |
91 self.__caseSensitivity = Qt.CaseInsensitive |
91 self.__caseSensitivity = Qt.CaseInsensitive |
92 |
92 |
93 self.setFilter(filter) |
93 self.setFilter(filterRule) |
94 |
94 |
95 def subscription(self): |
95 def subscription(self): |
96 """ |
96 """ |
97 Public method to get the subscription this rule belongs to. |
97 Public method to get the subscription this rule belongs to. |
98 |
98 |
106 |
106 |
107 @return rule filter string (string) |
107 @return rule filter string (string) |
108 """ |
108 """ |
109 return self.__filter |
109 return self.__filter |
110 |
110 |
111 def setFilter(self, filter): |
111 def setFilter(self, filterRule): |
112 """ |
112 """ |
113 Public method to set the rule filter string. |
113 Public method to set the rule filter string. |
114 |
114 |
115 @param filter rule filter string (string) |
115 @param filterRule rule filter string (string) |
116 """ |
116 """ |
117 self.__filter = filter |
117 self.__filter = filterRule |
118 self.__parseFilter() |
118 self.__parseFilter() |
119 |
119 |
120 def __parseFilter(self): |
120 def __parseFilter(self): |
121 """ |
121 """ |
122 Private method to parse the filter pattern. |
122 Private method to parse the filter pattern. |