MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/572159_SPICE/recipe-572159.py:115–125  ·  view source on GitHub ↗

Initialize the File_Crypt object.

(self,  major, minor, name, mode)

Source from the content-addressed store, hash-verified

113 'File_Crypt(major, minor, name, mode) -> File_Crypt'
114
115 def __init__(self, major, minor, name, mode):
116 'Initialize the File_Crypt object.'
117 _check_major(major)
118 _check_minor(minor)
119 self.__em1 = _encode_map_1(major)
120 self.__em2 = _encode_map_2(minor)
121 self.__dm1 = _decode_map_1(minor)
122 self.__dm2 = _decode_map_2(major)
123 assert len(mode) == 1 and mode in 'raw'
124 self.__file = open(name, mode + 'b', 0)
125 self.tail = ''
126
127 def read(self, size=-1):
128 'Read and decrypt from file.'

Callers

nothing calls this directly

Calls 7

_encode_map_1Function · 0.85
_encode_map_2Function · 0.85
_decode_map_1Function · 0.85
_decode_map_2Function · 0.85
_check_majorFunction · 0.70
_check_minorFunction · 0.70
openFunction · 0.50

Tested by

no test coverage detected