本文整理匯總了Python中objects.Objects.get方法的典型用法代碼示例。如果您正苦於以下問題:Python Objects.get方法的具體用法?Python Objects.get怎麽用?Python Objects.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類objects.Objects
的用法示例。
在下文中一共展示了Objects.get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ViewBase
# 需要導入模塊: from objects import Objects [as 別名]
# 或者: from objects.Objects import get [as 別名]
class ViewBase(object):
columns = COLUMNS
def __init__(self, host):
self.host = host
self.objects = Objects(host)
@property
def sp(self):
return self.host.sp
@property
def client(self):
return self.host.client
@staticmethod
def use_placeholders():
return Client.Product in [
'Plex Home Theater'
]
@classmethod
def append_header(cls, oc, title='', key=''):
oc.add(DirectoryObject(key=key, title=title))
def append_items(self, oc, items, count=COLUMNS, plain=False, placeholders=None):
"""Append spotify metadata `items` to an ObjectContainer"""
if placeholders is None:
placeholders = self.use_placeholders()
for x in range(count):
if x < len(items):
# Build object for metadata item
oc.add(self.objects.get(items[x]))
elif not plain and placeholders:
# Add a placeholder to fix alignment on PHT
self.append_header(oc)