(self, parent=None, session=None, **kwargs)
| 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__() |
nothing calls this directly
no test coverage detected