Skip to content
Browse files

Force proper initialization of keys and jumppoints for control socket.

  • Loading branch information...
1 parent c77d8ed commit 931fe9c46d12be016e6b952e2c68da887d5a05b2 @wagnerrp wagnerrp committed
Showing with 7 additions and 9 deletions.
  1. +7 −9 mythtv/bindings/python/MythTV/methodheap.py
View
16 mythtv/bindings/python/MythTV/methodheap.py
@@ -8,7 +8,7 @@
from MythTV.exceptions import *
from MythTV.logging import MythLog
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.system import SystemEvent
from MythTV.mythproto import BECache, FileOps, Program, FreeSpace, EventLock
@@ -489,13 +489,11 @@ def __repr__(self): return str(self)
def __init__(self, parent):
self._parent = proxy(parent)
- self._populated = False
self._points = {}
def _populate(self):
- if not self._populated:
- self._points = dict(self._parent.send('jump'))
- self._populated = True
+ self._populate = _donothing
+ self._points = dict(self._parent.send('jump'))
def __getitem__(self, key):
self._populate()
@@ -505,6 +503,7 @@ def __getitem__(self, key):
return False
def __getattr__(self, key):
+ self._populate()
if key in self.__dict__:
return self.__dict__[key]
return self.__getitem__(key)
@@ -534,13 +533,11 @@ def __repr__(self): return str(self)
def __init__(self, parent):
self._parent = proxy(parent)
- self._populated = False
self._keys = []
def _populate(self):
- if not self._populated:
- self._keys = self._parent.send('key')
- self._populated = True
+ self._populate = _donothing
+ self._keys = self._parent.send('key')
def _sendLiteral(self, key):
if (key in self._keys) or (key in self._alnum):
@@ -568,6 +565,7 @@ def __getitem__(self, key):
return False
def __getattr__(self, key):
+ self._populate()
if key in self.__dict__:
return self.__dict__[key]
return self._sendLiteral(key)

0 comments on commit 931fe9c

Please sign in to comment.
Something went wrong with that request. Please try again.