Package moppy :: Module searchreplace
[show private | hide private]
[frames | no frames]

Module moppy.searchreplace

Classes
AnyStringFilter Matches any string.
AttributeGetterCriteria  
AttributeSetterCriteria  
ClassFilter Filter that returns true if the provided comparator function returns true AND, the parentObj is a class
ClassMemberCriteria  
ClassNameCriteria  
FunctionNameCriteria  
MethodNameCriteria  
ModuleMemberCriteria  
ModuleNameFilter Filter that matches on a module name.
NotStringFilter Filter that returns true if the provided string is not equal to any strings in the provided list
ObjectComparatorFilter Filter that returns true if the provided comparator function returns true
ObjectEqualsFilter Filter that returns true if the other object is equal to the provided object.
ObjectNameFilter Filter that returns true if the other string is equal to one of the strings in the required list.
RequiredStringFilter Filter that returns true if the other string is equal to one of the strings in the required list.
SearchContext Provide a context holding useful objects during a recursive searching operation.

Exceptions
MemberNotFoundException Raise this if the desired member wasn't found.

Function Summary
  applyFilters(object, filterList)
Return True if the provided object passes through the filter list.
  getmodule(object)
Return the module an object was defined in, or None if not found.
  getModuleBaseFilename(modfileName)
Get the root filename of a module without the suffix i.e somemod.py-->somemod
  isClassMethod(func)
  recurseContainsObject(container, obj)
Return True if the provided object lives somewhere in the hierarchy starting with the container object.
  recurseGetAllMembers(obj)
Recursively return all members of the provided object
  recurseGetNormalMembers(obj)
Recursively return all normal (non builtin) members of the provided object
  recurseGetParentObject(container, obj)
Return the object that contains the provided object.
  recurseSelectMembers(obj, ctx)
Recursively search through all members of an object, and return those that match the search criteria
  replaceCallable(func, replacement, replaceGlobals)
Replace callable object with replacement callable
  replaceInGlobals(obj, replacement)
Walk each module to find any instances of this object that were imported into the module's namespace, and replace it

Variable Summary
dict modulesbyfile
NotStringFilter STD_IGNORE
list stdIgnore

Function Details

applyFilters(object, filterList)

Return True if the provided object passes through the filter list. Return False otherwise.

getmodule(object)

Return the module an object was defined in, or None if not found.

This was taken and modified slightly from the getmodule method in the inspect std python lib

getModuleBaseFilename(modfileName)

Get the root filename of a module without the suffix i.e somemod.py-->somemod

recurseContainsObject(container, obj)

Return True if the provided object lives somewhere in the hierarchy starting with the container object. Return False otherwise.

recurseGetAllMembers(obj)

Recursively return all members of the provided object

recurseGetNormalMembers(obj)

Recursively return all normal (non builtin) members of the provided object

recurseGetParentObject(container, obj)

Return the object that contains the provided object. For example, if you pass it the class method A.foo(), it will return the A class

recurseSelectMembers(obj, ctx)

Recursively search through all members of an object, and return those that match the search criteria

replaceCallable(func, replacement, replaceGlobals=1)

Replace callable object with replacement callable

replaceInGlobals(obj, replacement)

Walk each module to find any instances of this object that were imported into the module's namespace, and replace it

Variable Details

modulesbyfile

Type:
dict
Value:
{}                                                                     

STD_IGNORE

Type:
NotStringFilter
Value:
<moppy.searchreplace.NotStringFilter object at 0x819ac3c>              

stdIgnore

Type:
list
Value:
['__class__',
 '__delattr__',
 '__dict__',
 '__doc__',
 '__getattribute__',
 '__hash__',
 '__init__',
 '__module__',
...                                                                    

Generated by Epydoc 1.1 on Wed May 14 00:03:20 2003 http://epydoc.sf.net