Skip to content

Commit

Permalink
Force proper initialization of keys and jumppoints for control socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerrp committed May 27, 2012
1 parent c77d8ed commit 931fe9c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions mythtv/bindings/python/MythTV/methodheap.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from MythTV.exceptions import * from MythTV.exceptions import *
from MythTV.logging import MythLog from MythTV.logging import MythLog
from MythTV.connections import FEConnection, XMLConnection, BEEventConnection from MythTV.connections import FEConnection, XMLConnection, BEEventConnection
from MythTV.utility import databaseSearch, datetime, check_ipv6 from MythTV.utility import databaseSearch, datetime, check_ipv6, _donothing
from MythTV.database import DBCache, DBData from MythTV.database import DBCache, DBData
from MythTV.system import SystemEvent from MythTV.system import SystemEvent
from MythTV.mythproto import BECache, FileOps, Program, FreeSpace, EventLock from MythTV.mythproto import BECache, FileOps, Program, FreeSpace, EventLock
Expand Down Expand Up @@ -489,13 +489,11 @@ def __repr__(self): return str(self)


def __init__(self, parent): def __init__(self, parent):
self._parent = proxy(parent) self._parent = proxy(parent)
self._populated = False
self._points = {} self._points = {}


def _populate(self): def _populate(self):
if not self._populated: self._populate = _donothing
self._points = dict(self._parent.send('jump')) self._points = dict(self._parent.send('jump'))
self._populated = True


def __getitem__(self, key): def __getitem__(self, key):
self._populate() self._populate()
Expand All @@ -505,6 +503,7 @@ def __getitem__(self, key):
return False return False


def __getattr__(self, key): def __getattr__(self, key):
self._populate()
if key in self.__dict__: if key in self.__dict__:
return self.__dict__[key] return self.__dict__[key]
return self.__getitem__(key) return self.__getitem__(key)
Expand Down Expand Up @@ -534,13 +533,11 @@ def __repr__(self): return str(self)


def __init__(self, parent): def __init__(self, parent):
self._parent = proxy(parent) self._parent = proxy(parent)
self._populated = False
self._keys = [] self._keys = []


def _populate(self): def _populate(self):
if not self._populated: self._populate = _donothing
self._keys = self._parent.send('key') self._keys = self._parent.send('key')
self._populated = True


def _sendLiteral(self, key): def _sendLiteral(self, key):
if (key in self._keys) or (key in self._alnum): if (key in self._keys) or (key in self._alnum):
Expand Down Expand Up @@ -568,6 +565,7 @@ def __getitem__(self, key):
return False return False


def __getattr__(self, key): def __getattr__(self, key):
self._populate()
if key in self.__dict__: if key in self.__dict__:
return self.__dict__[key] return self.__dict__[key]
return self._sendLiteral(key) return self._sendLiteral(key)
Expand Down

0 comments on commit 931fe9c

Please sign in to comment.