40 |
40 |
41 class AdBlockRule(object): |
41 class AdBlockRule(object): |
42 """ |
42 """ |
43 Class implementing the AdBlock rule. |
43 Class implementing the AdBlock rule. |
44 """ |
44 """ |
45 def __init__(self, filter="", subscription=None): |
45 def __init__(self, filterRule="", subscription=None): |
46 """ |
46 """ |
47 Constructor |
47 Constructor |
48 |
48 |
49 @param filter filter string of the rule (string) |
49 @param filterRule filter string of the rule (string) |
50 @param subscription reference to the subscription object |
50 @param subscription reference to the subscription object |
51 (AdBlockSubscription) |
51 (AdBlockSubscription) |
52 """ |
52 """ |
53 self.__subscription = subscription |
53 self.__subscription = subscription |
54 |
54 |
84 self.__stylesheetException = False |
84 self.__stylesheetException = False |
85 self.__objectSubrequest = False |
85 self.__objectSubrequest = False |
86 self.__objectSubrequestException = False |
86 self.__objectSubrequestException = False |
87 self.__stringMatchRule = False |
87 self.__stringMatchRule = False |
88 |
88 |
89 self.setFilter(filter) |
89 self.setFilter(filterRule) |
90 |
90 |
91 def subscription(self): |
91 def subscription(self): |
92 """ |
92 """ |
93 Public method to get the subscription this rule belongs to. |
93 Public method to get the subscription this rule belongs to. |
94 |
94 |
102 |
102 |
103 @return rule filter string (string) |
103 @return rule filter string (string) |
104 """ |
104 """ |
105 return self.__filter |
105 return self.__filter |
106 |
106 |
107 def setFilter(self, filter): |
107 def setFilter(self, filterRule): |
108 """ |
108 """ |
109 Public method to set the rule filter string. |
109 Public method to set the rule filter string. |
110 |
110 |
111 @param filter rule filter string (string) |
111 @param filterRule rule filter string (string) |
112 """ |
112 """ |
113 self.__filter = filter |
113 self.__filter = filterRule |
114 self.__parseFilter() |
114 self.__parseFilter() |
115 |
115 |
116 def __parseFilter(self): |
116 def __parseFilter(self): |
117 """ |
117 """ |
118 Private method to parse the filter pattern. |
118 Private method to parse the filter pattern. |