~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to bindings/python/MythTV/MythData.py

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey), Jamie Bennett, Mario Limonciello, Dave Walker (Daviey)
  • Date: 2010-03-23 19:32:33 UTC
  • mfrom: (1.1.49 upstream)
  • Revision ID: james.westby@ubuntu.com-20100323193233-5sv9djoxtlmwt3ca
Tags: 0.23.0+fixes23789-0ubuntu1
[ Jamie Bennett ]
* Fix FTBFS on armel (LP: #537714)

[ Mario Limonciello ]
* mythtv-{common,backend}.{config,templates,postinst}: (LP: #483748)
  - Simplify debconf questions by avoiding showing the generated pw
  - Don't warn about mythtv group.
  - Don't notify about running mythtv-setup.  This is optional (but
    of course encouraged!)
* Set version to include a "+" delimitter.
* Restore libfaad-dev dependency. (LP: #546552)

[ Dave Walker (Daviey) ]
* New snapshot (r23789), based from 0.23-fixes.
* debian/control:
  - mythtv-frontend set to Conflict with mythflix, as it's dropped
    upstream. (LP: #544521)
  - Remove unnecessary and potentially problematic use of Pre-Depends.
  - Set the debug package to Priority extra.
  - Change *-perl Section's from libs to perl
  - add ${shlibs:Depends} for mythtv-common Depends field
  - Minor spelling fix.
  - Fixes the long description for one of the packages, ensuring the
    description doesn't exceed 80 characters.
  - Vcs-* set to -fixes, rather than -trunk.
* debian/rules:
  - Use debconf-updatepo to update translations when required
  - Ensure license files are not included in the binary packages, except 
    for debian/copyright.
  - Fixes the permissions of certain files in the packaging.
* debian/copyright:
  - updated to reflect that mythtv is GPL-2 only.
  - inserted better licence statement and Copyright reference.
* debian/mythtv-*.templates
  - Simplified strings; removed verbosity and improved readability.
* Prevent the maintainer scripts from failing in case any questions 
  can't be displayed.
* Added holding debian/mythtv-frontend.config, mainly to appease lintian.
* debian/mythtv-frontend.menu: Changed section to Applications/Graphics.
* debian/mythtv-backend.postinst: Load debconf libraries.
* debian/source.lintian-overrides: Removes the unecessary override of the 
  binNMU warnings.
* Fix perl binding installation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
                                'attempting remote write outside base path')
66
66
        return FileTransfer(host, filename, sgroup, type, db)
67
67
 
68
 
    sgs = db.getStorageGroup(groupname=sgroup, hostname=host)
 
68
    sgs = db.getStorageGroup(groupname=sgroup)
69
69
 
70
70
    if type == 'w':
71
71
        # prefer local storage always
274
274
        if whence == 0:
275
275
            if offset < 0:
276
276
                offset = 0
277
 
            if offset > self.size:
 
277
            elif offset > self.size:
278
278
                offset = self.size
279
279
        elif whence == 1:
280
280
            if offset + self.pos < 0:
281
281
                offset = -self.pos
282
 
            if offset + self.pos > self.size:
 
282
            elif offset + self.pos > self.size:
283
283
                offset = self.size - self.pos
284
284
        elif whence == 2:
285
285
            if offset > 0:
286
286
                offset = 0
287
 
            if offset < -self.size:
 
287
            elif offset < -self.size:
288
288
                offset = -self.size
 
289
            whence = 0
 
290
            offset = self.size+offset
289
291
 
290
 
        curhigh,curlow = self.splitInt(self.pos)
291
 
        offhigh,offlow = self.splitInt(offset)
 
292
        curhigh,curlow = self.control.splitInt(self.pos)
 
293
        offhigh,offlow = self.control.splitInt(offset)
292
294
 
293
295
        res = self.control.backendCommand('QUERY_FILETRANSFER '+BACKEND_SEP\
294
296
                        .join([str(self.sockno),'SEEK',str(offhigh),
295
297
                                str(offlow),str(whence),str(curhigh),
296
298
                                str(curlow)])\
297
299
                    ).split(BACKEND_SEP)
298
 
        self.pos = self.joinInt(int(res[0]),int(res[1]))
 
300
        self.pos = self.control.joinInt(int(res[0]),int(res[1]))
299
301
 
300
302
class FileOps( MythBEBase ):
301
303
    __doc__ = MythBEBase.__doc__+"""
302
 
    Includes several canned file management tasks.
 
304
        getRecording()      - return a Program object for a recording
 
305
        deleteRecording()   - notify the backend to delete a recording
 
306
        forgetRecording()   - allow a recording to re-record
 
307
        deleteFile()        - notify the backend to delete a file
 
308
                              in a storage group
 
309
        getHash()           - return the hash of a file in a storage group
 
310
        reschedule()        - trigger a run of the scheduler
303
311
    """
304
312
    logmodule = 'Python Backend FileOps'
305
313
 
340
348
                    'QUERY_FILE_HASH',file, sgroup)))
341
349
 
342
350
    def reschedule(self, recordid=-1):
343
 
        """FileOps.getHash() -> None"""
 
351
        """FileOps.reschedule() -> None"""
344
352
        self.backendCommand('RESCHEDULE_RECORDINGS '+str(recordid))
345
353
 
346
354
 
854
862
        elif (chanid is not None) and (starttime is not None):
855
863
            self.__dict__['where'] = 'chanid=%s AND starttime=%s'
856
864
            DBDataWrite.__init__(self, (chanid,starttime), db, None)
 
865
        else:
 
866
            DBDataWrite.__init__(self, None, db, None)
857
867
 
858
868
    def create(self, data=None):
859
869
        """Job.create(data=None) -> Job object"""
1057
1067
        c = self.db.cursor(self.log)
1058
1068
        fields = ' AND '.join(['%s=%%s' % f for f in \
1059
1069
                        ('title','subtitle','season','episode')])
1060
 
        count = c.execute("""SELECT inetref FROM videometadata WHERE %s""" %
 
1070
        count = c.execute("""SELECT intid FROM videometadata WHERE %s""" %
1061
1071
                fields, (self.title, self.subtitle, self.season, self.episode))
1062
1072
        if count:
1063
1073
            id = c.fetchone()[0]
1231
1241
        sep = '(?:\s?(?:-|/)?\s?)?'
1232
1242
        regex1 = re.compile('^(.*[^s0-9])'+sep \
1233
1243
                           +'(?:s|(?:Season))?'+sep \
1234
 
                           +'(\d{1,3})'+sep \
 
1244
                           +'(\d{1,4})'+sep \
1235
1245
                           +'(?:[ex/]|Episode)'+sep \
1236
1246
                           +'(\d{1,3})'+sep \
1237
1247
                           +'(.*)$', re.I)