Esempio n. 1
0
    def getTuners(self):
        """
        @rtype: Tuner[] 
        @return: Cached tuners ordered by cardid
        """
        sql = """
            select 
                cardid, 
                hostname, 
                signal_timeout, 
                channel_timeout, 
                cardtype
            from   
                capturecard
            order by 
                cardid
            """
        tuners = []
        self.cursor.execute(sql)
        
        from mythbox.mythtv.domain import Tuner

        for row in self.cursor.fetchall():
            row = self.toDict(self.cursor, row)
            tuners.append(Tuner(
                int(row['cardid']),
                row['hostname'],
                int(row['signal_timeout']),
                int(row['channel_timeout']),
                row['cardtype'],
                domainCache=self.domainCache,
                conn=None,
                db=self,   # TODO: Should be None. self is for unit tests
                translator=self.translator)) 
        return tuners
Esempio n. 2
0
 def setUp(self):
     self.db = Mock()
     self.conn = Mock()
     self.translator = Mock()
     self.domainCache = Mock()
     self.tuner = Tuner(4, 'mrbun', 1000, 6000, 'HDHOMERUN',
                        self.domainCache, self.conn, self.db,
                        self.translator)