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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from exceptions import * from exceptions import *
from logging import MythLog from logging import MythLog
from connections import FEConnection, XMLConnection from connections import FEConnection, XMLConnection
from utility import databaseSearch, datetime from utility import databaseSearch, datetime, _donothing
from database import DBCache, DBData from database import DBCache, DBData
from system import SystemEvent from system import SystemEvent
from mythproto import BEEvent, FileOps, Program, FreeSpace 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): 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 @@ -484,6 +482,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 @@ -513,13 +512,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 @@ -547,6 +544,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 9129079

Please sign in to comment.