Utilities/ModuleParser.py

changeset 5604
b047181a4a33
parent 5389
9b1c800daff3
child 5651
982465f8389c
diff -r 4f2dd0850803 -r b047181a4a33 Utilities/ModuleParser.py
--- a/Utilities/ModuleParser.py	Sat Mar 11 14:35:22 2017 +0100
+++ b/Utilities/ModuleParser.py	Sat Mar 11 18:08:42 2017 +0100
@@ -392,13 +392,13 @@
     """
     Class to represent a Python module.
     """
-    def __init__(self, name, file=None, type=None):
+    def __init__(self, name, file=None, moduleType=None):
         """
         Constructor
         
         @param name name of this module (string)
         @param file filename of file containing this module (string)
-        @param type type of this module
+        @param moduleType type of this module
         """
         self.name = name
         self.file = file
@@ -413,10 +413,10 @@
         self.imports = []
         self.from_imports = {}
         self.package = '.'.join(name.split('.')[:-1])
-        self.type = type
-        if type in [imp.PY_SOURCE, PTL_SOURCE]:
+        self.type = moduleType
+        if moduleType in [imp.PY_SOURCE, PTL_SOURCE]:
             self._getnext = _py_getnext
-        elif type == RB_SOURCE:
+        elif moduleType == RB_SOURCE:
             self._getnext = _rb_getnext
         else:
             self._getnext = None
@@ -495,18 +495,18 @@
         elif self.type == RB_SOURCE:
             self.__rb_scan(src)
     
-    def __py_setVisibility(self, object):
+    def __py_setVisibility(self, objectRef):
         """
         Private method to set the visibility of an object.
         
-        @param object reference to the object (Attribute, Class or Function)
+        @param objectRef reference to the object (Attribute, Class or Function)
         """
-        if object.name.startswith('__'):
-            object.setPrivate()
-        elif object.name.startswith('_'):
-            object.setProtected()
+        if objectRef.name.startswith('__'):
+            objectRef.setPrivate()
+        elif objectRef.name.startswith('_'):
+            objectRef.setProtected()
         else:
-            object.setPublic()
+            objectRef.setPublic()
     
     def __py_scan(self, src):
         """
@@ -1224,36 +1224,36 @@
         if self.type in [imp.PY_SOURCE, PTL_SOURCE]:
             py3ExtList = Preferences.getDebugger("Python3Extensions").split()
             if self.file.endswith(tuple(py3ExtList)):
-                type = "Python3"
+                moduleType = "Python3"
             else:
-                type = "Python2"
+                moduleType = "Python2"
         elif self.type == RB_SOURCE:
-            type = "Ruby"
+            moduleType = "Ruby"
         else:
-            type = ""
-        return type
+            moduleType = ""
+        return moduleType
 
 
 class Class(VisibilityBase):
     """
     Class to represent a Python class.
     """
-    def __init__(self, module, name, super, file, lineno):
+    def __init__(self, module, name, superClasses, file, lineno):
         """
         Constructor
         
         @param module name of module containing this class (string)
         @param name name of the class (string)
-        @param super list of classnames this class is inherited from
+        @param superClasses list of classnames this class is inherited from
                 (list of strings)
         @param file name of file containing this class (string)
         @param lineno linenumber of the class definition (integer)
         """
         self.module = module
         self.name = name
-        if super is None:
-            super = []
-        self.super = super
+        if superClasses is None:
+            superClasses = []
+        self.super = superClasses
         self.methods = {}
         self.attributes = {}
         self.globals = {}
@@ -1521,22 +1521,22 @@
     f = None
     if inpackage:
         try:
-            f, file, (suff, mode, type) = find_module(
+            f, file, (suff, mode, moduleType) = find_module(
                 module, path, _extensions)
         except ImportError:
             f = None
     if f is None:
         fullpath = list(path) + sys.path
-        f, file, (suff, mode, type) = find_module(
+        f, file, (suff, mode, moduleType) = find_module(
             module, fullpath, _extensions)
     if f:
         f.close()
-    if type not in SUPPORTED_TYPES:
+    if moduleType not in SUPPORTED_TYPES:
         # not supported source, can't do anything with this module
         _modules[modname] = Module(modname, None, None)
         return _modules[modname]
     
-    mod = Module(modname, file, type)
+    mod = Module(modname, file, moduleType)
     try:
         src = Utilities.readEncodedFile(file)[0]
         mod.scan(src)

eric ide

mercurial