/[svn.andrew.net.au]/mythtvdotpy/.Frontend.py.swp
ViewVC logotype

Contents of /mythtvdotpy/.Frontend.py.swp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8 - (show annotations)
Mon Nov 6 18:11:25 2006 UTC (15 years, 7 months ago) by apollock
File MIME type: application/octet-stream
File size: 12288 byte(s)
Initial check in

1 b0VIM 7.0wOEapollockicarus~apollock/dev/MythTV/Frontend.pyutf-8 U3210#"! Utpdad}!dgTA,O:98 ` _ ^ I  v d 8 7   i G 
2
3 3
4
5 e ] 5 - ,    ^10YQPO>%;:9(! pass def __init__(): """Container class for specifying what location the frontend is in"""class Location: pass #TODO(apollock): raise some sort of exception if result != "OK": result = self._sendcmd("play speed normal")[0] self._connect() """Resumes playback""" def play(self): pass #TODO(apollock): raise some sort of exception if result != "OK": result = self._sendcmd("play speed pause")[0] self._connect() """Pauses the playback""" def pause(self): return " ".join(result[2:]) (chanid, recdate, rectime))[0].split(" ") result = self._sendcmd("query recording %s %sT%s" % self._connect() """Returns recording information for a specified recording""" def recording(self, chanid, recdate, rectime): return location pass elif location['where'] == 'MainMenu': pass elif location['where'] == 'PlaybackBox': location['title'] = self.recording(location['chanid'], location['recdate'].isoformat(), location['rectime'].isoformat()) if location['what'] == 'Recorded': location['rectime'] = datetime.time(int(rectime[0]), int(rectime[1]), int(rectime[2])) rectime = result[7].split("T")[1].split(":") location['recdate'] = datetime.date(int(recdate[0]), int(recdate[1]), int(recdate[2])) recdate = result[7].split("T")[0].split("-") location['chanid'] = result[6] location['speed'] = result[5] location['length'] = result[4] location['position'] = result[2] location['what'] = result[1] if location['where'] == 'Playback': location['where'] = result[0] # Maybe return a location object instead? # than a string #TODO(apollock): convert date and time to something other result = self._sendcmd("query location")[0].split(" ") self._connect() location = {} """Return what location the front end is currently in""" def location(self): return self.socket.recv(4096).splitlines() self.socket.send("%s\r\n" % cmd) if self.ready: #TODO(apollock): raise an exception if not ready """Send a command to the frontend""" def _sendcmd(self, cmd): self.ready = True if self.socket.recv(4096).splitlines()[-1] == '# ': self.socket.connect((self.host, self.port)) self.socket = socket.socket() """Create a connection to the frontend""" def _connect(self): self.socket = None self.ready = False self.port = port self.host = host def __init__(self, host, port=6546): """Class for operating on a MythTV frontend"""class Frontend:import datetimeimport socket#!/usr/bin/python

Properties

Name Value
svn:mime-type application/octet-stream

  ViewVC Help
Powered by ViewVC 1.1.22