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
(cherry picked from commit 931fe9c)

Conflicts:

	mythtv/bindings/python/MythTV/methodheap.py
  • Loading branch information
wagnerrp committed May 27, 2012
1 parent cde2063 commit 9129079
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions mythtv/bindings/python/MythTV/methodheap.py
Expand Up @@ -10,7 +10,7 @@
from exceptions import *
from logging import MythLog
from connections import FEConnection, XMLConnection
from utility import databaseSearch, datetime
from utility import databaseSearch, datetime, _donothing
from database import DBCache, DBData
from system import SystemEvent
from mythproto import BEEvent, FileOps, Program, FreeSpace
Expand Down Expand Up @@ -468,13 +468,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()
Expand All @@ -484,6 +482,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)
Expand Down Expand Up @@ -513,13 +512,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):
Expand Down Expand Up @@ -547,6 +544,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)
Expand Down

0 comments on commit 9129079

Please sign in to comment.