MCPcopy Index your code
hub / github.com/O365/python-o365 / _update_data

Method _update_data

O365/drive.py:1431–1452  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

1429 self._update_data(kwargs)
1430
1431 def _update_data(self, data):
1432 cloud_data = data.get(self._cloud_data_key, {})
1433
1434 self.object_id = cloud_data.get(self._cc('id'))
1435 # Fallback to manual drive
1436 self.name = cloud_data.get(self._cc('name'), data.get('name',
1437 ''))
1438 self.description = cloud_data.get(self._cc('description'))
1439 self.drive_type = cloud_data.get(self._cc('driveType'))
1440 self.web_url = cloud_data.get(self._cc('webUrl'))
1441
1442 owner = cloud_data.get(self._cc('owner'), {}).get('user', None)
1443 self.owner = Contact(con=self.con, protocol=self.protocol,
1444 **{self._cloud_data_key: owner}) if owner else None
1445 self.quota = cloud_data.get(self._cc('quota')) # dict
1446
1447 created = cloud_data.get(self._cc('createdDateTime'), None)
1448 modified = cloud_data.get(self._cc('lastModifiedDateTime'), None)
1449 local_tz = self.protocol.timezone
1450 self.created = parse(created).astimezone(local_tz) if created else None
1451 self.modified = parse(modified).astimezone(
1452 local_tz) if modified else None
1453
1454 def __str__(self):
1455 return self.__repr__()

Callers 2

__init__Method · 0.95
refreshMethod · 0.95

Calls 3

ContactClass · 0.85
_ccMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected