mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-18 05:48:26 +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'
|
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):
|
def _loadData(self, data):
|
||||||
self._data = data
|
self._data = data
|
||||||
self._initpath = '/system/agents'
|
self._initpath = '/system/agents'
|
||||||
|
@ -685,6 +689,11 @@ class Agent(PlexObject):
|
||||||
|
|
||||||
|
|
||||||
class AgentMediaType(Agent):
|
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):
|
def _loadData(self, data):
|
||||||
self.mediaType = data.attrib.get('mediaType')
|
self.mediaType = data.attrib.get('mediaType')
|
||||||
self.name = data.attrib.get('name')
|
self.name = data.attrib.get('name')
|
||||||
|
|
Loading…
Add table
Reference in a new issue