pyce
pyce copied to clipboard
Standardise encrypt_path result and PYCEPathFinder.KEYS input.
encrypt_path returns a tuple of file location and key whereas the PYCEPathFinder.KEYS accepts a dictionary.
>>> encrypt_path('.')
[('./hello.pyce', '69b9f28ba960bb3a83abef44950c99baf427f671bc33cd112cf87e22259ab835'), ('./mod.pyce', 'b6bea595bea6b95098d9b9a4f98e17cb399c99d3cdd99daeab5078757ec65f3c')]
PYCEPathFinder.KEYS = {'hello.pyce':'69b9f28ba960bb3a83abef44950c99baf427f671bc33cd112cf87e22259ab835','mod.pyce':'b6bea595bea6b95098d9b9a4f98e17cb399c99d3cdd99daeab5078757ec65f3c'}
Right now I'm doing this to standardise the output form encrypt_path()
keys_as_tup = encrypt_path('.')
keys = {}
for tup in keys_as_tup:
keys[os.path.basename(tup[0])] = tup[1]
Can I have a PR to return keys as dict?
Why not...
dict(encrypt_path('.'))