Ticket #8406: python.pginfo.patch

File python.pginfo.patch, 4.5 KB (added by Raymond Wagner, 16 years ago)

updated patch for python bindings

  • MythStatic.py

     
    88MVSCHEMA_VERSION = 1033
    99NVSCHEMA_VERSION = 1004
    1010PROTO_VERSION = 56
    11 PROGRAM_FIELDS = 47
    1211BACKEND_SEP = '[]:[]'
  • MythData.py

     
    531531    _field_order = [ 'title',        'subtitle',     'description',
    532532                     'category',     'chanid',       'channum',
    533533                     'callsign',     'channame',     'filename',
    534                      'fs_high',      'fs_low',       'starttime',
    535                      'endtime',      'duplicate',    'shareable',
     534                     'filesize',     'starttime',    'endtime',     
    536535                     'findid',       'hostname',     'sourceid',
    537536                     'cardid',       'inputid',      'recpriority',
    538537                     'recstatus',    'recordid',     'rectype',
    539538                     'dupin',        'dupmethod',    'recstartts',
    540                      'recendts',     'repeat',       'programflags',
    541                      'recgroup',     'commfree',     'outputfilters',
    542                      'seriesid',     'programid',    'lastmodified',
    543                      'stars',        'airdate',      'hasairdate',
     539                     'recendts',     'programflags', 'recgroup',     
     540                     'outputfilters','seriesid',     'programid',
     541                     'lastmodified', 'stars',        'airdate',
    544542                     'playgroup',    'recpriority2', 'parentid',
    545543                     'storagegroup', 'audio_props',  'video_props',
    546544                     'subtitle_type','year']
    547545    _field_type = [  3,      3,      3,
    548546                     3,      0,      3,
    549547                     3,      3,      3,
    550                      0,      0,      4,
    551                      4,      0,      0,
     548                     0,      4,      4,               
    552549                     0,      3,      0,
    553550                     0,      0,      0,
    554551                     0,      0,      3,
    555552                     0,      0,      4,
    556                      4,      0,      3,
    557                      3,      0,      3,
     553                     4,      3,      3,
    558554                     3,      3,      3,
    559                      1,      3,      0,
     555                     3,      1,      3,
    560556                     3,      0,      3,
    561557                     3,      0,      0,
    562558                     0,      0]
     
    582578            for key in ('title','subTitle','seriesId','programId','airdate',
    583579                    'category','hostname','chanNum','callSign','playGroup',
    584580                    'recGroup','rectype','programFlags','chanId','recStatus',
    585                     'commFree','stars'):
     581                    'commFree','stars','filesize'):
    586582                if key in xmldat:
    587583                    dat[key.lower()] = xmldat[key]
    588584            for key in ('startTime','endTime','lastModified',
     
    590586                if key in xmldat:
    591587                    dat[key.lower()] = str(int(mktime(strptime(
    592588                                        xmldat[key], '%Y-%m-%dT%H:%M:%S'))))
    593             if 'fileSize' in xmldat:
    594                 dat['fs_high'],dat['fs_low'] = \
    595                                     self.splitInt(int(xmldat['fileSize']))
    596589
    597590            raw = []
    598591            defs = (0,0,0,'',0)
     
    605598        else:
    606599            raise InputError("Either 'raw' or 'etree' must be provided")
    607600        self._db = DBCache(db)
    608         self.filesize = self.joinInt(self.fs_high,self.fs_low)
    609601
    610602    def toString(self):
    611603        """
  • MythFunc.py

     
    189189        self.freeTuner()
    190190
    191191    def _getPrograms(self, query, recstatus=None, header=0):
     192        pgfieldcount = len(Program._field_order)
    192193        programs = []
    193194        res = self.backendCommand(query).split(BACKEND_SEP)
    194195        for i in range(header):
     
    196197
    197198        num_progs = int(res.pop(0))
    198199        for i in range(num_progs):
    199             offs = i * PROGRAM_FIELDS
    200             programs.append(Program(res[offs:offs+PROGRAM_FIELDS], db=self.db))
     200            offs = i * pgfieldcount
     201            programs.append(Program(res[offs:offs+pgfieldcount], db=self.db))
    201202
    202203        if recstatus:
    203204            for i in reversed(range(num_progs)):