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

Method __init__

O365/excel.py:45–69  ·  view source on GitHub ↗

Create a workbook session object. :param parent: parent for this operation :param Connection con: connection to use if no parent specified :param Bool persist: Whether or not to persist the session changes

(self, *, parent=None, con=None, persist=True, **kwargs)

Source from the content-addressed store, hash-verified

43 }
44
45 def __init__(self, *, parent=None, con=None, persist=True, **kwargs):
46 """ Create a workbook session object.
47
48 :param parent: parent for this operation
49 :param Connection con: connection to use if no parent specified
50 :param Bool persist: Whether or not to persist the session changes
51 """
52 if parent and con:
53 raise ValueError('Need a parent or a connection but not both')
54 self.con = parent.con if parent else con
55
56 # Choose the main_resource passed in kwargs over parent main_resource
57 main_resource = kwargs.pop('main_resource', None) or (
58 getattr(parent, 'main_resource', None) if parent else None)
59
60 super().__init__(
61 protocol=parent.protocol if parent else kwargs.get('protocol'),
62 main_resource=main_resource)
63
64 self.persist = persist
65
66 self.inactivity_limit = dt.timedelta(seconds=PERSISTENT_SESSION_INACTIVITY_MAX_AGE) \
67 if persist else dt.timedelta(seconds=NON_PERSISTENT_SESSION_INACTIVITY_MAX_AGE)
68 self.session_id = None
69 self.last_activity = dt.datetime.now()
70
71 def __str__(self):
72 return self.__repr__()

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected