[mythtv-commits] Ticket #6678: Additional functions for Python bindings
MythTV
mythtv at cvs.mythtv.org
Sun Jul 12 06:38:40 UTC 2009
#6678: Additional functions for Python bindings
---------------------------------------------------+------------------------
Reporter: Raymond Wagner <raymond at wagnerrp.com> | Owner: awithers
Type: enhancement | Status: new
Priority: minor | Milestone: 0.22
Component: Bindings - Python | Version: head
Severity: medium | Resolution:
Mlocked: 0 |
---------------------------------------------------+------------------------
Comment(by Raymond Wagner <raymond at wagnerrp.com>):
Patch 7 adds a minor tweek to the UTF-8 support from R.D.Vaughan. It also
adds the FileTransfer class.
MythTV.FileTransfer(file[,parent]):
'file' can take the form of a Program object, or a tuple containing
(backend, filename, storagegroup)
filename is a relative path from the storagegroup base, starting
with a '/'
'parent' is an optional command object (MythTV.MythTV()). If none is
given, it will open a new one internally to use
The class uses the standard file i/o functions:
FileTransfer.close()[[br]]
FileTransfer.tell()[[br]]
FileTransfer.read(byte count)[[br]]
This currently pulls up to 64KB at a time, but will buffer an
unlimited amount of bytes before returning the data. Don't go overboard
here, because python will be buffering this in memory.[[br]]
FileTransfer.rewind()[[br]]
FileTransfer.seek(byte offset[,whence])[[br]]
'whence' is an optional integer where 0 seeks absolute from file
start, and 1 seeks relative from the current position. Default behavior
is 0 (absolute).
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/6678#comment:6>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list