def get_mem_storage(self, storage_id='', window_id=10000):
"""
Creates an in-memory storage for this addon with :class:`dict`-like
interface
The storage can store picklable Python objects as long as
Kodi is running and storage contents can be shared between
Python processes. Different addons have separate storages,
so storages with the same names created with this method
do not conflict.
Example::
addon = Addon()
storage = addon.get_mem_storage()
foo = storage['foo']
storage['bar'] = bar
:param storage_id: optional storage ID (case-insensitive).
:type storage_id: str
:param window_id: the ID of a Kodi Window object where storage contents
will be stored.
:type window_id: int
:return: in-memory storage for this addon
:rtype: MemStorage
"""
if storage_id:
storage_id = '{0}_{1}'.format(self.id, storage_id)
return MemStorage(storage_id, window_id)
评论列表
文章目录