本文整理汇总了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)