MCPcopy Create free account
hub / github.com/O365/python-o365 / __init__

Method __init__

O365/excel.py:290–320  ·  view source on GitHub ↗
(self, parent=None, session=None, **kwargs)

Source from the content-addressed store, hash-verified

288 }
289
290 def __init__(self, parent=None, session=None, **kwargs):
291 if parent and session:
292 raise ValueError('Need a parent or a session but not both')
293
294 self.range = parent
295 self.session = parent.session if parent else session
296
297 # Choose the main_resource passed in kwargs over parent main_resource
298 main_resource = kwargs.pop('main_resource', None) or (
299 getattr(parent, 'main_resource', None) if parent else None)
300
301 # append the format path
302 main_resource = '{}/format'.format(main_resource)
303
304 super().__init__(
305 protocol=parent.protocol if parent else kwargs.get('protocol'),
306 main_resource=main_resource)
307
308 self._track_changes = TrackerSet(casing=self._cc)
309 self._track_background_color = False
310
311 cloud_data = kwargs.get(self._cloud_data_key, {})
312
313 self._column_width = cloud_data.get('columnWidth', 11)
314 self._horizontal_alignment = cloud_data.get('horizontalAlignment', 'General')
315 self._row_height = cloud_data.get('rowHeight', 15)
316 self._vertical_alignment = cloud_data.get('verticalAlignment', 'Bottom')
317 self._wrap_text = cloud_data.get('wrapText', None)
318
319 self._font = RangeFormatFont(self)
320 self._background_color = UnsetSentinel
321
322 def __str__(self):
323 return self.__repr__()

Callers

nothing calls this directly

Calls 4

TrackerSetClass · 0.85
RangeFormatFontClass · 0.85
__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected