mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 11:43:13 +00:00
add __repr__ to Agent and AgentMediaType classes
This commit is contained in:
parent
07e3d66b4f
commit
99bfdb8129
1 changed files with 9 additions and 0 deletions
|
@ -668,6 +668,10 @@ class Agent(PlexObject):
|
|||
"""
|
||||
TAG = 'Agent'
|
||||
|
||||
def __repr__(self):
|
||||
uid = self._clean(self.firstAttr('shortIdentifier'))
|
||||
return '<%s>' % ':'.join([p for p in [self.__class__.__name__, uid] if p])
|
||||
|
||||
def _loadData(self, data):
|
||||
self._data = data
|
||||
self._initpath = '/system/agents'
|
||||
|
@ -685,6 +689,11 @@ class Agent(PlexObject):
|
|||
|
||||
|
||||
class AgentMediaType(Agent):
|
||||
|
||||
def __repr__(self):
|
||||
uid = self._clean(self.firstAttr('name'))
|
||||
return '<%s>' % ':'.join([p for p in [self.__class__.__name__, uid] if p])
|
||||
|
||||
def _loadData(self, data):
|
||||
self.mediaType = data.attrib.get('mediaType')
|
||||
self.name = data.attrib.get('name')
|
||||
|
|
Loading…
Reference in a new issue