Crossfire Server, Trunk
CFDataFile.CFData Class Reference
+ Collaboration diagram for CFDataFile.CFData:

Public Member Functions

def __init__ (self, filename, header)
 
def exist (self, name)
 
def get_keys (self)
 
def get_record (self, name)
 
def put_record (self, record)
 
def remove_record (self, name)
 

Data Fields

 datadb
 
 datafile
 
 header
 

Detailed Description

CFData Object is basically a dictionary parsed from the datafile -
serves to pass back and forth a dictionary containing the datafile header
and the desired record to the caller - easier to read the 

Definition at line 94 of file CFDataFile.py.

Constructor & Destructor Documentation

◆ __init__()

def CFDataFile.CFData.__init__ (   self,
  filename,
  header 
)

Definition at line 99 of file CFDataFile.py.

Member Function Documentation

◆ exist()

def CFDataFile.CFData.exist (   self,
  name 
)
checks if a record exists given the primary key as "name"

Definition at line 122 of file CFDataFile.py.

References CFDataFile.CFData.datadb.

Referenced by CFDataFile.CFData.get_record().

+ Here is the caller graph for this function:

◆ get_keys()

def CFDataFile.CFData.get_keys (   self)
returns a sorted list of the primary keys (usually names) in the datafile

Definition at line 150 of file CFDataFile.py.

References CFDataFile.CFData.datadb, hall_of_fame.keys, and guildoracle.list.

◆ get_record()

def CFDataFile.CFData.get_record (   self,
  name 
)
returns a small dictionary of the header and the record by "name"

Definition at line 129 of file CFDataFile.py.

References CFDataFile.CFData.datadb, CFDataFile.CFData.exist(), and CFDataFile.CFData.header.

+ Here is the call graph for this function:

◆ put_record()

def CFDataFile.CFData.put_record (   self,
  record 
)
adds an line entry to the datafile

Definition at line 140 of file CFDataFile.py.

References CFDataFile.CFData.datadb, CFDataFile.CFData.datafile, and CFDataFile.CFData.header.

◆ remove_record()

def CFDataFile.CFData.remove_record (   self,
  name 
)

Definition at line 114 of file CFDataFile.py.

References CFDataFile.CFData.datadb, and CFDataFile.CFData.datafile.

Field Documentation

◆ datadb

◆ datafile

CFDataFile.CFData.datafile

Definition at line 101 of file CFDataFile.py.

Referenced by CFDataFile.CFData.put_record(), and CFDataFile.CFData.remove_record().

◆ header

CFDataFile.CFData.header

Definition at line 100 of file CFDataFile.py.

Referenced by CFDataFile.CFData.get_record(), and CFDataFile.CFData.put_record().


The documentation for this class was generated from the following file: