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

Diff of /mythtvdotpy/MythTV/Frontend.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by apollock, Mon Nov 6 18:54:11 2006 UTC revision 11 by apollock, Mon Nov 6 19:18:08 2006 UTC
# Line 11  class FrontendCmdFailure(Exception): Line 11  class FrontendCmdFailure(Exception):
11          pass          pass
12    
13    
14    class FrontendInvalidInput(Exception):
15            pass
16    
17    
18  class Frontend:  class Frontend:
19          """Class for operating on a MythTV frontend"""          """Class for operating on a MythTV frontend"""
20    
# Line 112  class Frontend: Line 116  class Frontend:
116                          else:                          else:
117                                  return loc1.program.position == loc2.program.position                                  return loc1.program.position == loc2.program.position
118    
119            def targets(self):
120                    """Returns a list of targets that jump() accepts"""
121                    result = self._sendcmd("help jump")
122                    return [x.split(" ")[0] for x in result[3:]]
123    
124    
125            def jump(self, target):
126                    """Jumps to the specified location"""
127                    if target not in self.targets():
128                            raise FrontendInvalidInput("Invalid jump target '%s'" % target)
129                    else:
130                            result = self._sendcmd("jump %s" % target)[0]
131                            if result != 'OK':
132                                    raise FrontendCmdFailure("Frontend said '%s' in response to 'jump %s' command" % (result, target))
133    
134    
135  class Location:  class Location:
136          """Container for where the frontend currently is"""          """Container for where the frontend currently is"""

Legend:
Removed from v.10  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.22