51 |
51 |
52 class AdBlockRule(object): |
52 class AdBlockRule(object): |
53 """ |
53 """ |
54 Class implementing the AdBlock rule. |
54 Class implementing the AdBlock rule. |
55 """ |
55 """ |
56 def __init__(self, filter=""): |
56 def __init__(self, filter="", subscription=None): |
57 """ |
57 """ |
58 Constructor |
58 Constructor |
59 """ |
59 """ |
|
60 self.__subscription = subscription |
|
61 |
60 self.__regExp = QRegExp() |
62 self.__regExp = QRegExp() |
61 self.__options = [] |
63 self.__options = [] |
62 self.__blockedDomains = [] |
64 self.__blockedDomains = [] |
63 self.__allowedDomains = [] |
65 self.__allowedDomains = [] |
64 |
66 |
82 self.__elemhide = False |
84 self.__elemhide = False |
83 self.__caseSensitivity = Qt.CaseInsensitive |
85 self.__caseSensitivity = Qt.CaseInsensitive |
84 |
86 |
85 self.setFilter(filter) |
87 self.setFilter(filter) |
86 |
88 |
|
89 def subscription(self): |
|
90 """ |
|
91 Public method to get the subscription this rule belongs to. |
|
92 |
|
93 @return subscription of the rule (AdBlockSubscription) |
|
94 """ |
|
95 return self.__subscription |
|
96 |
87 def filter(self): |
97 def filter(self): |
88 """ |
98 """ |
89 Public method to get the rule filter string. |
99 Public method to get the rule filter string. |
90 |
100 |
91 @return rule filter string (string) |
101 @return rule filter string (string) |