Package winappdbg :: Module crash :: Class DummyCrashContainer
[hide private]
[frames] | no frames]

Class DummyCrashContainer

source code

   object --+        
            |        
ContainerBase --+    
                |    
   CrashContainer --+
                    |
                   DummyCrashContainer

Fakes a database of volatile Crash objects, trying to mimic part of it's interface, but doesn't actually store anything.


See Also: Crash.key

Instance Methods [hide private]
 
__init__(self, allowRepeatedKeys=True)
Fake containers don't store Crash objects, but they implement the interface properly.
source code
bool
__contains__(self, crash)
Returns: True if the Crash object is in the container.
source code
int
__len__(self)
Returns: Count of Crash elements in the container.
source code
bool
__bool__(self)
Returns: False if the container is empty.
source code
 
add(self, crash)
Adds a new crash to the container.
source code
bool
has_key(self, key)
Returns: True if a matching Crash object is in the container.
source code
iterator
iterkeys(self)
Returns: Iterator of the contained Crash object keys.
source code
 
__del__(self)
Class destructor. (Inherited from winappdbg.crash.CrashContainer)
source code
iterator
__iter__(self)
Returns: Iterator of the contained Crash objects. (Inherited from winappdbg.crash.CrashContainer)
source code
Crash object.
get(self, key)
Retrieves a crash from the container. (Inherited from winappdbg.crash.CrashContainer)
source code
iterator
itervalues(self)
Returns: Iterator of the contained Crash objects. (Inherited from winappdbg.crash.CrashContainer)
source code
str or buffer
marshall_key(self, key)
Marshalls a Crash key to be used in the database. (Inherited from winappdbg.crash.ContainerBase)
source code
str
marshall_value(self, value, storeMemoryMap=False)
Marshalls a Crash object to be used in the database. (Inherited from winappdbg.crash.ContainerBase)
source code
 
remove(self, crash)
Removes a crash from the container. (Inherited from winappdbg.crash.CrashContainer)
source code
 
remove_key(self, key)
Removes the given key from the set of known keys. (Inherited from winappdbg.crash.ContainerBase)
source code
Crash key.
unmarshall_key(self, key)
Unmarshalls a Crash key read from the database. (Inherited from winappdbg.crash.ContainerBase)
source code
Crash
unmarshall_value(self, value)
Unmarshalls a Crash object read from the database. (Inherited from winappdbg.crash.ContainerBase)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
bool binaryKeys = False
True to marshall keys to binary format (the Python buffer type), False to use text marshalled keys (str type). (Inherited from winappdbg.crash.CrashContainer)
bool binaryValues = False
True to marshall values to binary format (the Python buffer type), False to use text marshalled values (str type). (Inherited from winappdbg.crash.CrashContainer)
bool compressKeys = False
True to compress keys when marshalling, False to leave them uncompressed. (Inherited from winappdbg.crash.CrashContainer)
bool compressValues = True
True to compress values when marshalling, False to leave them uncompressed. (Inherited from winappdbg.crash.CrashContainer)
bool escapeKeys = False
True to escape keys when marshalling, False to leave them uncompressed. (Inherited from winappdbg.crash.CrashContainer)
bool escapeValues = False
True to escape values when marshalling, False to leave them uncompressed. (Inherited from winappdbg.crash.CrashContainer)
bool optimizeKeys = False
True to optimize the marshalling of keys, False otherwise. (Inherited from winappdbg.crash.CrashContainer)
bool optimizeValues = True
True to optimize the marshalling of keys, False otherwise. (Inherited from winappdbg.crash.CrashContainer)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, allowRepeatedKeys=True)
(Constructor)

source code 

Fake containers don't store Crash objects, but they implement the interface properly.

Parameters:
  • allowRepeatedKeys (bool) - If True the len() of the container returns the total number of Crash objects added.

    If False the len() of the container returns the total number of Crash objects keys added.

Overrides: object.__init__

__contains__(self, crash)
(In operator)

source code 
Parameters:
  • crash (Crash) - Crash object.
Returns: bool
True if the Crash object is in the container.
Overrides: ContainerBase.__contains__

__len__(self)
(Length operator)

source code 
Returns: int
Count of Crash elements in the container.
Overrides: ContainerBase.__len__

__bool__(self)

source code 
Returns: bool
False if the container is empty.
Overrides: ContainerBase.__bool__

add(self, crash)

source code 

Adds a new crash to the container.

Parameters:
  • crash (Crash) - Crash object to add.
Overrides: CrashContainer.add

Note: When the allowRepeatedKeys parameter of the constructor is set to False, duplicated crashes are ignored.

See Also: Crash.key

has_key(self, key)

source code 
Parameters:
  • key (Crash unique key.) - Key of the crash to get.
Returns: bool
True if a matching Crash object is in the container.
Overrides: ContainerBase.has_key

iterkeys(self)

source code 
Returns: iterator
Iterator of the contained Crash object keys.
Overrides: ContainerBase.iterkeys

See Also: get

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.