Module vtab_media :: Class Media
[show private | hide private]
[frames | no frames]

Type Media

object --+    
         |    
ModuleBase --+
             |
            Media


Module to implements a virtual table that stores media data as native system files. The table has 2 fiels: __rowid__ and mediadata This class maintains its own rowid, cursor, and constraints parameters. The data of each row is stored in a file named Fxxxxxxx, where xxxxxxx is the rowid starting with 1 ie (F0000001, F0000002, etc)
Method Summary
  __init__(self, pathname)
  BestIndex(self, constraints, orderby)
Provide information on how to best access this table.
  Column(self, N)
Find the value for the N-th column of the current row.
  Eof(self)
Determines if the current cursor points to a valid row.
  filenamefromid(self, id)
  Filter(self, idxNum, idxStr, argv)
Begin a search of a virtual table.
  getnextrowid(self)
Return the next row ID from a file called rowid
  idfromfilename(self, filename)
  incrementrowid(self)
  Next(self)
Move the cursor to the next row.
  Rowid(self)
Return the rowid of the current row.
  saverowid(self, id)
  UpdateChangeRow(self, rowid, newrowid, fields)
Change the row of the current rowid with the new rowid and new values
  UpdateDeleteRow(self, rowid)
Delete row rowid
  UpdateInsertRow(self, rowid, fields)
Insert a new row of data into the table
    Inherited from ModuleBase
  Begin(self)
  Close(self)
Close a cursor previously created by Open By default, do nothing
  Commit(self)
  Connect(self, connection, modulename, databasename, vtablename, *args)
Connect to an existing virtual table, by default it is identical to Create
  Create(self, connection, modulename, databasename, vtablename, *args)
Called when the virtual table is created.
  Destroy(self)
Release a connection to a virtual table and destroy the underlying table implementation.
  Disconnect(self)
Release a connection to a virtual table.
  Open(self)
Create/prepare a cursor used for subsequent reading.
  Rollback(self)
  Sync(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, pathname)
(Constructor)

Overrides:
database.ModuleBase.__init__

BestIndex(self, constraints, orderby)

Provide information on how to best access this table.
Must be overriden by subclass.
@params constraints: a tuple of (column #, op) defining a constraints
@params orderby: a tuple of (column #, desc) defining the order by
@returns a tuple of up to 5 values:
    0: aConstraingUsage: a tuple of the same size as constraints.
        Each item is either None, argv index(int), or (argv index, omit(Bool)).
    1: idxNum(int)
    2: idxStr(string)
    3: orderByConsumed(Bool)
    4: estimatedCost(float)

Todo: store the constraints for subsequent evaluation, and tell
    sqlite to pass the constraints parameters to Filter.
Overrides:
database.ModuleBase.BestIndex

Column(self, N)

Find the value for the N-th column of the current row.
Returns:
value of the N-th column We only have 2 columns: __rowid__ and mediadata
Overrides:
database.ModuleBase.Column

Eof(self)

Determines if the current cursor points to a valid row.
Returns:
False if valid row, True otherwise
Overrides:
database.ModuleBase.Eof

Filter(self, idxNum, idxStr, argv)

Begin a search of a virtual table.
Returns:

None

Todo: evaluate actual constraints, will let sqlite do the orderby.
Overrides:
database.ModuleBase.Filter

getnextrowid(self)

Return the next row ID from a file called rowid

Next(self)

Move the cursor to the next row.
Returns:
None
Overrides:
database.ModuleBase.Next

Rowid(self)

Return the rowid of the current row.
Returns:
the rowid(int) of the current row.
Overrides:
database.ModuleBase.Rowid

UpdateChangeRow(self, rowid, newrowid, fields)

Change the row of the current rowid with the new rowid and new values
Returns:
rowid of the new row
Overrides:
database.ModuleBase.UpdateChangeRow

UpdateDeleteRow(self, rowid)

Delete row rowid
Returns:
None
Overrides:
database.ModuleBase.UpdateDeleteRow

UpdateInsertRow(self, rowid, fields)

Insert a new row of data into the table
Returns:
rowid of the new row.
Overrides:
database.ModuleBase.UpdateInsertRow

Generated by Epydoc 2.1 on Fri Aug 15 18:58:27 2008 http://epydoc.sf.net