pyce icon indicating copy to clipboard operation
pyce copied to clipboard

Standardise encrypt_path result and PYCEPathFinder.KEYS input.

Open adamshamsudeen opened this issue 5 years ago • 2 comments

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'}

adamshamsudeen avatar Oct 11 '18 17:10 adamshamsudeen

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?

adamshamsudeen avatar Oct 17 '18 13:10 adamshamsudeen

Why not...

dict(encrypt_path('.'))

VeNoMouS avatar Sep 24 '19 02:09 VeNoMouS