Skip to content

Commit

Permalink
Add support for reading from Shared with me
Browse files Browse the repository at this point in the history
  • Loading branch information
j0nnyr0berts committed Oct 13, 2022
1 parent 6d5e19e commit 923434a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tentaclio_gdrive/clients/google_drive_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _drive(self):
drives = self._get_drives()
if self.drive_name not in drives:
names = [d for d in drives]
raise ValueError(f"Drive name (hostname) should be one of {names}")
raise ValueError(f"Drive name {self.drive_name} should be one of {names}")
return drives[self.drive_name]

def _connect(self) -> "GoogleDriveFSClient":
Expand Down Expand Up @@ -262,6 +262,8 @@ def _get_path_descriptors(self, ignore_tail=False) -> List[_GoogleFileDescriptor
parts = self.path_parts
if ignore_tail:
parts = parts[:-1]
if self.drive_name == "Shared with me":
return [self._get_file_descriptor_by_name(parts[0])]
return list(self._path_parts_to_descriptors(self._drive, parts))

def _path_parts_to_descriptors(
Expand Down

0 comments on commit 923434a

Please sign in to comment.