以下不是我的代码,而是我必须使用的代码......
class MediaRoot:
def __init__(self, type):
self.name = ''
self.year = None
self.type = type
self.parts = []
self.subtitles = []
self.thumbs = []
self.arts = []
self.trailers = []
self.released_at = None
self.display_offset = 0
self.source = None
self.themes = []
class Movie(MediaRoot):
def __init__(self, name, year=None):
MediaRoot.__init__(self,'Movie')
self.name = name
self.year = year
self.guid = None
我有一个名为“媒体”的电影类型的对象,我可以使用它的名称和年份属性并执行所有标准操作。我也知道在“源”中存储了一个我非常想访问的值,但是每当我尝试它时,它都会因以下错误而炸毁我:
File "/Users/john/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 626, in __getattr__
return object.__getattr__(self, name)
AttributeError: type object 'object' has no attribute '__getattr__'
这个属性是永远遥不可及吗?