Skip to content

Commit 2e8afd6

Browse files
committed
adding key and bucket to the CloudObjectLocal
1 parent 0d4135c commit 2e8afd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lithops/storage/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ def __str__(self):
6565
class CloudObjectLocal:
6666
def __init__(self, path):
6767
self.path = path
68+
slash = self.path.rfind('/')
69+
if slash > 0:
70+
self.bucket = self.path[:slash]
71+
self.key = self.path[slash+1:]
72+
else:
73+
self.bucket = '/'
74+
self.key = path
75+
6876

6977
def __str__(self):
7078
return '<CloudObject at {}>'.format(self.path)

0 commit comments

Comments
 (0)