bfe3da6658 2010-10-14 1: ##
bfe3da6658 2010-10-14 2: # py-spacemap root package
bfe3da6658 2010-10-14 3: # http://code.google.com/p/py-spacemap
bfe3da6658 2010-10-14 4: ##
bfe3da6658 2010-10-14 5:
bfe3da6658 2010-10-14 6: """
bfe3da6658 2010-10-14 7: This module provides simple class to work with spacemaps, objects that marks
bfe3da6658 2010-10-14 8: some portions of given range.
bfe3da6658 2010-10-14 9:
bfe3da6658 2010-10-14 10: Imagine that we have range of 10 bytes. So we want to mark bytes 2 - 3 as used
bfe3da6658 2010-10-14 11: and also 8 - 9. I know this just a rough example.
bfe3da6658 2010-10-14 12:
bfe3da6658 2010-10-14 13: Any range can be given as pair x:y where x is part of the marked range and y -
bfe3da6658 2010-10-14 14: next free space. In mathematical notation this is equal to [x:y).
bfe3da6658 2010-10-14 15:
bfe3da6658 2010-10-14 16: Module also can:
bfe3da6658 2010-10-14 17:
bfe3da6658 2010-10-14 18: - autoshrink maps, i.e. [2:3),[3:6) = [2:6);
bfe3da6658 2010-10-14 19:
bfe3da6658 2010-10-14 20: - substract maps, the product of A - B is all space in A that is not covered
bfe3da6658 2010-10-14 21: by B, i.e. [2:10) - [5:7) = [2:5),[7,10);
bfe3da6658 2010-10-14 22:
bfe3da6658 2010-10-14 23: - get intersection (logical or), the product of A and B is all space that can
bfe3da6658 2010-10-14 24: be found both in A and in B, i.e. [2:10) and [5:15) = [5:10);
bfe3da6658 2010-10-14 25:
bfe3da6658 2010-10-14 26: - compare maps.
bfe3da6658 2010-10-14 27:
bfe3da6658 2010-10-14 28: more will be added soon...
bfe3da6658 2010-10-14 29: """
bfe3da6658 2010-10-14 30:
bfe3da6658 2010-10-14 31: __all__ = [
bfe3da6658 2010-10-14 32: '__author__',
bfe3da6658 2010-10-14 33: '__date__',
bfe3da6658 2010-10-14 34: '__version__',
bfe3da6658 2010-10-14 35: '__docformat__',
bfe3da6658 2010-10-14 36: 'version',
bfe3da6658 2010-10-14 37: 'version_info',
bfe3da6658 2010-10-14 38: 'SpaceMap',
bfe3da6658 2010-10-14 39: 'test',
bfe3da6658 2010-10-14 40: ]
bfe3da6658 2010-10-14 41:
bfe3da6658 2010-10-14 42: # Optional.
bfe3da6658 2010-10-14 43: try:
bfe3da6658 2010-10-14 44: from .project import version_info, version, author as __author__, date as __date__
bfe3da6658 2010-10-14 45: __version__ = version
bfe3da6658 2010-10-14 46: from .test import test
bfe3da6658 2010-10-14 47: except ImportError:
bfe3da6658 2010-10-14 48: pass
bfe3da6658 2010-10-14 49:
bfe3da6658 2010-10-14 50: from .spacemap import SpaceMap