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

Public Member Functions

def __init__ (self, datafile_name)
 
def exists (self)
 
def getData (self)
 
def make_file (self, header)
 
def putData (self, dic)
 

Public Attributes

 datafile_name
 
 filename
 

Detailed Description

Plain text storage for Crossfire data

Definition at line 23 of file CFDataFile.py.

Constructor & Destructor Documentation

◆ __init__()

def CFDataFile.CFDataFile.__init__ (   self,
  datafile_name 
)
make datafile paths for datafile 'object'
- these all go in ../var/crossfire/datafiles to keep the local dir clean

Definition at line 26 of file CFDataFile.py.

Member Function Documentation

◆ exists()

def CFDataFile.CFDataFile.exists (   self)
checks for datafile - no need to load it yet

Definition at line 32 of file CFDataFile.py.

References CFDataFile.CFDataFile.filename.

◆ getData()

def CFDataFile.CFDataFile.getData (   self)
Gets the formatted file as a dictionary
The # key contains the column headers for the file and indicates the 'primary' key

Definition at line 54 of file CFDataFile.py.

References CFDataFile.CFDataFile.filename, CFBank.open(), and split().

Here is the call graph for this function:

◆ make_file()

def CFDataFile.CFDataFile.make_file (   self,
  header 
)
creates a datafile, making the column header from a list passed in

Definition at line 39 of file CFDataFile.py.

References CFDataFile.CFDataFile.datafile_name, CFDataFile.CFDataFile.filename, CFBank.open(), and make_face_from_files.str.

Here is the call graph for this function:

◆ putData()

def CFDataFile.CFDataFile.putData (   self,
  dic 
)
Writes dictionary to formatted file - uses | character as a delimiter

Definition at line 72 of file CFDataFile.py.

References CFDataFile.CFDataFile.datafile_name, CFDataFile.CFDataFile.filename, guildoracle.list, CFBank.open(), and make_face_from_files.str.

Here is the call graph for this function:

Member Data Documentation

◆ datafile_name

CFDataFile.CFDataFile.datafile_name

Definition at line 29 of file CFDataFile.py.

Referenced by CFDataFile.CFDataFile.make_file(), and CFDataFile.CFDataFile.putData().

◆ filename


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