Part of twisted.python View Source
| Class | Settable | A mixin class for syntactic sugar. Lets you assign attributes by | 
| Class | AccessorType | Metaclass that generates properties automatically. | 
| Class | PropertyAccessor | A mixin class for Python 2.2 that uses AccessorType. | 
| Class | Accessor | Extending this class will give you explicit accessor methods; a | 
| Class | Summer | Extend from this class to get the capability to maintain 'related | 
| Class | QueueMethod | I represent a method that doesn't exist yet. | 
| Function | funcinfo | this is more documentation for myself than useful code. | 
| Function | fullFuncName | Undocumented | 
| Function | qual | Return full import path of a class. | 
| Function | getcurrent | Undocumented | 
| Function | getClass | Return the class or type of object 'obj'. | 
| Function | isinst | Undocumented | 
| Function | namedModule | Return a module given its name. | 
| Function | namedObject | Get a fully named module-global object. | 
| Class | InvalidName | The given name is not a dot-separated list of Python objects. | 
| Class | ModuleNotFound | The module associated with the given name doesn't exist and it can't be | 
| Class | ObjectNotFound | The object associated with the given name doesn't exist and it can't be | 
| Function | namedAny | Retrieve a Python object by its fully qualified name from the global Python | 
| Function | macro | macro(name, source, **identifiers) | 
| Function | safe_repr | safe_repr(anything) -> string | 
| Function | safe_str | safe_str(anything) -> string | 
| Function | allYourBase | allYourBase(classObj, baseClass=None) -> list of all base | 
| Function | accumulateBases | Undocumented | 
| Function | prefixedMethodNames | A list of method names with a given prefix in a given class. | 
| Function | addMethodNamesToDict | addMethodNamesToDict(classObj, dict, prefix, baseClass=None) -> dict | 
| Function | prefixedMethods | A list of methods with a given prefix on a given instance. | 
| Function | accumulateMethods | accumulateMethods(instance, dict, prefix) | 
| Function | accumulateClassDict | Accumulate all attributes of a given name in a class heirarchy into a single dictionary. | 
| Function | accumulateClassList | Accumulate all attributes of a given name in a class heirarchy into a single list. | 
| Function | isSame | Undocumented | 
| Function | isLike | Undocumented | 
| Function | modgrep | Undocumented | 
| Function | isOfType | Undocumented | 
| Function | findInstances | Undocumented | 
| Function | objgrep | An insanely CPU-intensive process for finding stuff. | 
| Function | filenameToModuleName | Convert a name in the filesystem to the name of the Python module it is. | 
| Function | fullyQualifiedName | Return the fully qualified name of a module, class, method or function. | 
| Class | _NoModuleFound | No module was found because none exists. | 
| Function | _importAndCheckStack | Import the given name as a module, then walk the stack to determine whether | 
| Function | _determineClass | Undocumented | 
| Function | _determineClassName | Undocumented | 
| Function | _safeFormat | Helper function for safe_repr and
safe_str. | 
  
| Raises | Exception | if something bad happens. This can be any type of exception, since nobody knows what loading some arbitrary code might do. | 
| _NoModuleFound | if no module was found. | 
| Parameters | name | The name of the object to return.
 (type: str
) | 
| Returns | the Python object identified by 'name'. | |
| Raises | InvalidName | If the name is an empty string, starts or ends with a '.', or is otherwise syntactically incorrect. | 
| ModuleNotFound | If the name is syntactically correct but the module it specifies cannot be imported because it does not appear to exist. | |
| ObjectNotFound | If the name is syntactically correct, includes at least one '.', but the module it specifies cannot be imported because it does not appear to exist. | |
| AttributeError | If an attribute of an object along the way cannot be accessed, or a module along the way is not found. | |
This allows you to create macro-like behaviors in python.
Returns a string representation of an object, or a string containing a traceback, if that object's __repr__ raised an exception.
Returns a string representation of an object, or a string containing a traceback, if that object's __str__ raised an exception.
If the class in question has the methods 'prefix_methodname' and 'prefix_methodname2', the resulting dict should look something like: {"methodname": 1, "methodname2": 1}.
Assuming all class attributes of this name are dictionaries. If any of the dictionaries being accumulated have the same key, the one highest in the class heirarchy wins. (XXX: If "higest" means "closest to the starting class".)
Ex:
| class Soy: | properties = {"taste": "bland"} | | class Plant: | properties = {"colour": "green"} | | class Seaweed(Plant): | pass | | class Lunch(Soy, Seaweed): | properties = {"vegan": 1 } | | dct = {} | | accumulateClassDict(Lunch, "properties", dct) | | print dct
{"taste": "bland", "colour": "green", "vegan": 1}
Assuming all class attributes of this name are lists.
This is agressive about getting a module name back from a file; it will always return a string. Agressive means 'sometimes wrong'; it won't look at the Python path or try to do any error checking: don't use this method unless you already know that the filename you're talking about is a Python module.
| Returns |  (type: str.
) | |