src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityContext.py

branch
eric7
changeset 10996
a3dc181d14e1
parent 10507
d1c6608155ef
child 11090
f5f5f5803935
equal deleted inserted replaced
10995:f94a27bbf6c4 10996:a3dc181d14e1
233 literalValue = returnList 233 literalValue = returnList
234 234
235 elif isinstance(literal, ast.Tuple): 235 elif isinstance(literal, ast.Tuple):
236 returnTuple = () 236 returnTuple = ()
237 for ti in literal.elts: 237 for ti in literal.elts:
238 returnTuple = returnTuple + (self.__getLiteralValue(ti),) 238 returnTuple += (self.__getLiteralValue(ti),)
239 literalValue = returnTuple 239 literalValue = returnTuple
240 240
241 elif isinstance(literal, ast.Set): 241 elif isinstance(literal, ast.Set):
242 returnSet = set() 242 returnSet = set()
243 for si in literal.elts: 243 for si in literal.elts:
319 319
320 def getOffsetForCallArg(self, argumentName): 320 def getOffsetForCallArg(self, argumentName):
321 """ 321 """
322 Public method to get the offset for a specific named argument. 322 Public method to get the offset for a specific named argument.
323 323
324 @param argumentName name of the argument to get the line number for 324 @param argumentName name of the argument to get the column offset for
325 @type str 325 @type str
326 @return offset of the found argument or -1 326 @return offset of the found argument or -1
327 @rtype int 327 @rtype int
328 """ 328 """
329 if hasattr(self.node, "keywords"): 329 if hasattr(self.node, "keywords"):
386 """ 386 """
387 try: 387 try:
388 return any(module in imp for imp in self.__context["imports"]) 388 return any(module in imp for imp in self.__context["imports"])
389 except KeyError: 389 except KeyError:
390 return False 390 return False
391
392 @property
393 def filename(self):
394 """
395 Public method to get the file name.
396
397 @return file name
398 @rtype str
399 """
400 return self.__context.get("filename")
401
402 @property
403 def fileData(self):
404 """
405 Public method to get the file contents.
406
407 @return file contents
408 @rtype str
409 """
410 return self.__context.get("filedata")

eric ide

mercurial