def from_id(cls, creds_json, root_id, *args, **kwargs) -> cls:
     drive = GoogleDrive(creds_json)
     root = drive.item_by_id(root_id)
     if root.isfolder():
         return cls(root, *args, **kwargs)
     else:
         raise FileNotFoundError("ID {} is not a folder".format(root_id))
Пример #2
0
 def from_id(cls, creds_json, root_id, *args, **kwargs) -> cls:
     drive = GoogleDrive(creds_json)
     root = drive.item_by_id(root_id)
     if root.isfolder():
         new_obj = cls(root, *args, **kwargs)
         new_obj.creator = "from_path"
         return new_obj
     else:
         raise FileNotFoundError("ID {} is not a folder".format(root_id))