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

Function get_key

recipes/Python/456374_Crypt/recipe-456374.py:166–176  ·  view source on GitHub ↗

Gets key data. Gets the source of the key. Loads the data of the key. Closes the key file. Returns the key.

()

Source from the content-addressed store, hash-verified

164 print 'Please enter a different filename.'
165
166def get_key():
167 '''Gets key data.
168
169 Gets the source of the key.
170 Loads the data of the key.
171 Closes the key file.
172 Returns the key.'''
173 key_file = get_source('What is the name of the key file?')
174 key = Unpickler(key_file).load()
175 key_file.close()
176 return key
177
178def work_encode(source, destination, key):
179 '''Encodes and saves a file.

Callers 4

encode_fileFunction · 0.70
decode_fileFunction · 0.70
_sortFileMethod · 0.50
_mergeFilesMethod · 0.50

Calls 3

get_sourceFunction · 0.70
loadMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected