XYZ File Manager
Current Path:
/lib/python3.9/site-packages/S3
lib
/
python3.9
/
site-packages
/
S3
/
📁
..
📄
ACL.py
(8.4 KB)
📄
AccessLog.py
(3.54 KB)
📄
BaseUtils.py
(10.21 KB)
📄
BidirMap.py
(1.37 KB)
📄
CloudFront.py
(36.71 KB)
📄
Config.py
(29.24 KB)
📄
ConnMan.py
(12.98 KB)
📄
Crypto.py
(12.62 KB)
📄
Custom_httplib27.py
(7.99 KB)
📄
Custom_httplib3x.py
(11.24 KB)
📄
Exceptions.py
(4.74 KB)
📄
ExitCodes.py
(2.2 KB)
📄
FileDict.py
(2.68 KB)
📄
FileLists.py
(28.15 KB)
📄
HashCache.py
(1.91 KB)
📄
MultiPart.py
(13.33 KB)
📄
PkgInfo.py
(934 B)
📄
Progress.py
(8.35 KB)
📄
S3.py
(102.36 KB)
📄
S3Uri.py
(7.69 KB)
📄
SortedDict.py
(3.08 KB)
📄
Utils.py
(10.77 KB)
📄
__init__.py
(24 B)
📁
__pycache__
Editing: BidirMap.py
# -*- coding: utf-8 -*- ## -------------------------------------------------------------------- ## Amazon S3 manager ## ## Authors : Michal Ludvig <michal@logix.cz> (https://www.logix.cz/michal) ## Florent Viard <florent@sodria.com> (https://www.sodria.com) ## Copyright : TGRMN Software, Sodria SAS and contributors ## License : GPL Version 2 ## Website : https://s3tools.org ## -------------------------------------------------------------------- class BidirMap(object): def __init__(self, **map): self.k2v = {} self.v2k = {} for key in map: self.__setitem__(key, map[key]) def __setitem__(self, key, value): if value in self.v2k: if self.v2k[value] != key: raise KeyError("Value '"+str(value)+"' already in use with key '"+str(self.v2k[value])+"'") try: del(self.v2k[self.k2v[key]]) except KeyError: pass self.k2v[key] = value self.v2k[value] = key def __getitem__(self, key): return self.k2v[key] def __str__(self): return self.v2k.__str__() def getkey(self, value): return self.v2k[value] def getvalue(self, key): return self.k2v[key] def keys(self): return [key for key in self.k2v] def values(self): return [value for value in self.v2k] # vim:et:ts=4:sts=4:ai
Upload File
Create Folder