Base.Entry

Name

Base.Entry -- Holds all the fields describing a bibliographic entry

Synopsis

class Base.Entry:
    self.id
    self.key
    self.type

    def __init__    (self, key = None, type = None, dict = None):
    def keys        (self):
    def has_key     (self, key):
    def field_and_loss (self, key):
    def __getitem__ (self, key):
    def __setitem__ (self, name, value):
    def __delitem__ (self, name):
    def __add__     (self, other):

Usage

An Entry holds all the fields that describe a bibliographic item. It basically behaves like a dictionnary, whose values are instances of Fields.

An entry can be pickled and unpickled to be transferred between application windows (copy/paste or drag and drop for example).

Members

self.id

String representation of the Entry specific class.

self.key

An instance of Key, which is the key by which the entry can be retrieved from its database.

self.type

An instance of EntryDescription, that holds type information for all the fields of the entry.

Methods

__init__ (self, key = None, type = None, dict = None)

Creates a new entry and initializes some of its fields.

keys (self)

Returns a list of the available fields

has_key (self, key)

Indicates if the entry holds the given field

field_and_loss (self, fieldname)

Returns a 2-uplet (string, bool), where the first element is the field, and the seconf a flag indicating if it has been converted with no loss

__getitem__ (self, fieldname)

field = entry [fieldname]

Returns a field given its name

__setitem__ (self, fieldname, field)

Sets a field.

__delitem__ (self, key)

Removes a field.

__add__ (self, entry)

Merges two entries together, taking only the missing fields from the second entry.