Closed arham-sayyed closed 2 months ago
Title: Improved download and get_url methods in Storage class
This PR addresses issues with the download and get_url methods in the Storage class. The changes ensure more consistent behavior and cleaner code.
download
get_url
Storage
Download Method:
lstrip
Get URL Method:
Before:
def download(self, path, filename, token=None): ... if path.startswith('/'): path = path[1:] ... def get_url(self, token): ... if path.startswith('/'): path = path[1:] ...
After:
def download(self, path, filename, token=None): ... path = path.lstrip('/') ... def get_url(self, token): ... path = self.path if self.path else '' path = path.lstrip('/') ...
These changes result in a cleaner and more maintainable codebase. They also ensure consistent behavior when manipulating paths in the Storage class.
Credits: @ndesamuelmbah
Fixed None Path breaking the code in get_url() function.
Title: Improved download and get_url methods in Storage class
Description:
This PR addresses issues with the
download
andget_url
methods in theStorage
class. The changes ensure more consistent behavior and cleaner code.Changes:
Download Method:
lstrip
for cleaner removal of leading slashes.Get URL Method:
lstrip
to ensure consistent behavior.Code Changes:
Before:
After:
Impact:
These changes result in a cleaner and more maintainable codebase. They also ensure consistent behavior when manipulating paths in the
Storage
class.Credits: @ndesamuelmbah