src/eric7/WebBrowser/GreaseMonkey/GreaseMonkeyScript.py

branch
eric7
changeset 10436
f6881d10e995
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
46 46
47 def __init__(self, manager, path): 47 def __init__(self, manager, path):
48 """ 48 """
49 Constructor 49 Constructor
50 50
51 @param manager reference to the manager object (GreaseMonkeyManager) 51 @param manager reference to the manager object
52 @param path path of the Javascript file (string) 52 @type GreaseMonkeyManager
53 @param path path of the Javascript file
54 @type str
53 """ 55 """
54 super().__init__(manager) 56 super().__init__(manager)
55 57
56 self.__manager = manager 58 self.__manager = manager
57 self.__fileWatcher = DelayedFileWatcher(parent=None) 59 self.__fileWatcher = DelayedFileWatcher(parent=None)
88 90
89 def isValid(self): 91 def isValid(self):
90 """ 92 """
91 Public method to check the validity of the script. 93 Public method to check the validity of the script.
92 94
93 @return flag indicating a valid script (boolean) 95 @return flag indicating a valid script
96 @rtype bool
94 """ 97 """
95 return self.__valid 98 return self.__valid
96 99
97 def name(self): 100 def name(self):
98 """ 101 """
99 Public method to get the name of the script. 102 Public method to get the name of the script.
100 103
101 @return name of the script (string) 104 @return name of the script
105 @rtype str
102 """ 106 """
103 return self.__name 107 return self.__name
104 108
105 def nameSpace(self): 109 def nameSpace(self):
106 """ 110 """
107 Public method to get the name space of the script. 111 Public method to get the name space of the script.
108 112
109 @return name space of the script (string) 113 @return name space of the script
114 @rtype str
110 """ 115 """
111 return self.__namespace 116 return self.__namespace
112 117
113 def fullName(self): 118 def fullName(self):
114 """ 119 """
115 Public method to get the full name of the script. 120 Public method to get the full name of the script.
116 121
117 @return full name of the script (string) 122 @return full name of the script
123 @rtype str
118 """ 124 """
119 return "{0}/{1}".format(self.__namespace, self.__name) 125 return "{0}/{1}".format(self.__namespace, self.__name)
120 126
121 def description(self): 127 def description(self):
122 """ 128 """
123 Public method to get the description of the script. 129 Public method to get the description of the script.
124 130
125 @return description of the script (string) 131 @return description of the script
132 @rtype str
126 """ 133 """
127 return self.__description 134 return self.__description
128 135
129 def version(self): 136 def version(self):
130 """ 137 """
131 Public method to get the version of the script. 138 Public method to get the version of the script.
132 139
133 @return version of the script (string) 140 @return version of the script
141 @rtype str
134 """ 142 """
135 return self.__version 143 return self.__version
136 144
137 def icon(self): 145 def icon(self):
138 """ 146 """
145 153
146 def iconUrl(self): 154 def iconUrl(self):
147 """ 155 """
148 Public method to get the icon URL of the script. 156 Public method to get the icon URL of the script.
149 157
150 @return icon URL of the script (QUrl) 158 @return icon URL of the script
159 @rtype QUrl
151 """ 160 """
152 return QUrl(self.__iconUrl) 161 return QUrl(self.__iconUrl)
153 162
154 def downloadUrl(self): 163 def downloadUrl(self):
155 """ 164 """
156 Public method to get the download URL of the script. 165 Public method to get the download URL of the script.
157 166
158 @return download URL of the script (QUrl) 167 @return download URL of the script
168 @rtype QUrl
159 """ 169 """
160 return QUrl(self.__downloadUrl) 170 return QUrl(self.__downloadUrl)
161 171
162 def updateUrl(self): 172 def updateUrl(self):
163 """ 173 """
164 Public method to get the update URL of the script. 174 Public method to get the update URL of the script.
165 175
166 @return update URL of the script (QUrl) 176 @return update URL of the script
177 @rtype QUrl
167 """ 178 """
168 return QUrl(self.__updateUrl) 179 return QUrl(self.__updateUrl)
169 180
170 def startAt(self): 181 def startAt(self):
171 """ 182 """
172 Public method to get the start point of the script. 183 Public method to get the start point of the script.
173 184
174 @return start point of the script (DocumentStart or DocumentEnd) 185 @return start point of the script
186 @rtype DocumentStart or DocumentEnd
175 """ 187 """
176 return self.__startAt 188 return self.__startAt
177 189
178 def noFrames(self): 190 def noFrames(self):
179 """ 191 """
186 198
187 def isEnabled(self): 199 def isEnabled(self):
188 """ 200 """
189 Public method to check, if the script is enabled. 201 Public method to check, if the script is enabled.
190 202
191 @return flag indicating an enabled state (boolean) 203 @return flag indicating an enabled state
204 @rtype bool
192 """ 205 """
193 return self.__enabled and self.__valid 206 return self.__enabled and self.__valid
194 207
195 def setEnabled(self, enable): 208 def setEnabled(self, enable):
196 """ 209 """
197 Public method to enable a script. 210 Public method to enable a script.
198 211
199 @param enable flag indicating the new enabled state (boolean) 212 @param enable flag indicating the new enabled state
213 @type bool
200 """ 214 """
201 self.__enabled = enable 215 self.__enabled = enable
202 216
203 def include(self): 217 def include(self):
204 """ 218 """
205 Public method to get the list of included URLs. 219 Public method to get the list of included URLs.
206 220
207 @return list of included URLs (list of strings) 221 @return list of included URLs
222 @rtype list of str
208 """ 223 """
209 return self.__include[:] 224 return self.__include[:]
210 225
211 def exclude(self): 226 def exclude(self):
212 """ 227 """
213 Public method to get the list of excluded URLs. 228 Public method to get the list of excluded URLs.
214 229
215 @return list of excluded URLs (list of strings) 230 @return list of excluded URLs
231 @rtype list of str
216 """ 232 """
217 return self.__exclude[:] 233 return self.__exclude[:]
218 234
219 def require(self): 235 def require(self):
220 """ 236 """
221 Public method to get the list of required scripts. 237 Public method to get the list of required scripts.
222 238
223 @return list of required scripts (list of strings) 239 @return list of required scripts
240 @rtype list of str
224 """ 241 """
225 return self.__require[:] 242 return self.__require[:]
226 243
227 def fileName(self): 244 def fileName(self):
228 """ 245 """
229 Public method to get the path of the Javascript file. 246 Public method to get the path of the Javascript file.
230 247
231 @return path of the Javascript file (string) 248 @return path of the Javascript file
249 @rtype str
232 """ 250 """
233 return self.__fileName 251 return self.__fileName
234 252
235 def isUpdating(self): 253 def isUpdating(self):
236 """ 254 """

eric ide

mercurial