MCPcopy Create free account
hub / github.com/dbr/tvdb_api / __getitem__

Method __getitem__

tvdb_api.py:1141–1153  ·  view source on GitHub ↗

Handles tvdb_instance['seriesname'] calls. The dict index should be the show id

(self, key)

Source from the content-addressed store, hash-verified

1139 return sid
1140
1141 def __getitem__(self, key):
1142 """Handles tvdb_instance['seriesname'] calls.
1143 The dict index should be the show id
1144 """
1145 if isinstance(key, int_types):
1146 sid = key
1147 else:
1148 sid = self._nameToSid(key)
1149 LOG.debug('Got series id %s' % sid)
1150
1151 if sid not in self.shows:
1152 self._getShowData(sid, self.config['language'])
1153 return self.shows[sid]
1154
1155 def __repr__(self):
1156 return repr(self.shows)

Callers

nothing calls this directly

Calls 2

_nameToSidMethod · 0.95
_getShowDataMethod · 0.95

Tested by

no test coverage detected