Back to index

python3.2  3.2.2
Public Member Functions
trace.Ignore Class Reference
Inheritance diagram for trace.Ignore:
Inheritance graph
[legend]
Collaboration diagram for trace.Ignore:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def names

Detailed Description

Definition at line 820 of file trace.py.


Constructor & Destructor Documentation

def trace.Ignore.__init__ (   self,
  modules = None,
  dirs = None 
)

Reimplemented from trace._Ignore.

Definition at line 821 of file trace.py.

00821 
00822     def __init__(self, modules=None, dirs=None):
00823         _warn("The class trace.Ignore is deprecated",
00824              DeprecationWarning, 2)
00825         _Ignore.__init__(self, modules, dirs)

Here is the caller graph for this function:


Member Function Documentation

def trace._Ignore.names (   self,
  filename,
  modulename 
) [inherited]

Definition at line 138 of file trace.py.

00138 
00139     def names(self, filename, modulename):
00140         if modulename in self._ignore:
00141             return self._ignore[modulename]
00142 
00143         # haven't seen this one before, so see if the module name is
00144         # on the ignore list.
00145         if modulename in self._mods:  # Identical names, so ignore
00146             self._ignore[modulename] = 1
00147             return 1
00148 
00149         # check if the module is a proper submodule of something on
00150         # the ignore list
00151         for mod in self._mods:
00152             # Need to take some care since ignoring
00153             # "cmp" mustn't mean ignoring "cmpcache" but ignoring
00154             # "Spam" must also mean ignoring "Spam.Eggs".
00155             if modulename.startswith(mod + '.'):
00156                 self._ignore[modulename] = 1
00157                 return 1
00158 
00159         # Now check that filename isn't in one of the directories
00160         if filename is None:
00161             # must be a built-in, so we must ignore
00162             self._ignore[modulename] = 1
00163             return 1
00164 
00165         # Ignore a file when it contains one of the ignorable paths
00166         for d in self._dirs:
00167             # The '+ os.sep' is to ensure that d is a parent directory,
00168             # as compared to cases like:
00169             #  d = "/usr/local"
00170             #  filename = "/usr/local.py"
00171             # or
00172             #  d = "/usr/local.py"
00173             #  filename = "/usr/local.py"
00174             if filename.startswith(d + os.sep):
00175                 self._ignore[modulename] = 1
00176                 return 1
00177 
00178         # Tried the different ways, so we don't ignore this module
00179         self._ignore[modulename] = 0
00180         return 0


The documentation for this class was generated from the following file: