pyffi :: formats :: kfm :: KfmFormat :: Class KfmFormat
[hide private]
[frames] | no frames]

Class KfmFormat

source code

              object --+        
                       |        
object_models.FileFormat --+    
                           |    
object_models.xml.FileFormat --+
                               |
                              KfmFormat

This class implements the kfm file format.
Nested Classes [hide private]
  int
Basic implementation of a 32-bit signed integer type.
  uint
Implementation of a 32-bit unsigned integer type.
  byte
Implementation of a 8-bit unsigned integer type.
  char
Implementation of an (unencoded) 8-bit character.
  short
Implementation of a 16-bit signed integer type.
  ushort
Implementation of a 16-bit unsigned integer type.
  float
Implementation of a 32-bit float.
  SizedString
Basic type for strings.
  TextString
Basic type for undecoded data trailing at the end of a file.
  HeaderString
The kfm header string.
  FilePath
  Header
A class to contain the actual kfm data.
  Animation
  Data
A class to contain the actual kfm data.
  IntermediateAnim
  Transition
  _Animation
  _Header

Inherited from object_models.xml.FileFormat: __metaclass__

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from object_models.xml.FileFormat: vercondFilter

Inherited from object_models.FileFormat: name_attribute, name_class, name_parts, walk, walkData

Static Methods [hide private]
 
version_number(version_str)
Converts version string into an integer.
source code
Class Variables [hide private]
  xml_file_name = 'kfm.xml'
Override.
  xml_file_path = [None, '/usr/lib/python2.7/site-packages/pyffi...
Override.
  RE_FILENAME = re.compile(r'(?i)^.*\.kfm$')
Override this with a regular expression (the result of a re.compile call) for the file extension of the format you are implementing.
  _EPSILON = 0.0001
  games = {'Civilization IV': [16777216, 16927488, 33554443], 'E...
  versions = {'1.0': 16777216, '1.2.4b': 16927488, '2.0.0.0b': 3...
  xml_struct = [<class 'pyffi.formats.kfm._Animation'>, <class '...

Inherited from object_models.xml.FileFormat: logger, xml_alias, xml_bit_struct, xml_enum

Inherited from object_models.FileFormat: ARCHIVE_CLASSES

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

version_number(version_str)
Static Method

source code 

Converts version string into an integer.

>>> hex(KfmFormat.version_number('1.0'))
'0x1000000'
>>> hex(KfmFormat.version_number('1.2.4b'))
'0x1024b00'
>>> hex(KfmFormat.version_number('2.2.0.0b'))
'0x202000b'
Parameters:
  • version_str (str) - The version string.
Returns:
A version integer.
Overrides: object_models.FileFormat.version_number

Class Variable Details [hide private]

xml_file_path

Override.
Value:
[None, '/usr/lib/python2.7/site-packages/pyffi/formats/kfm/kfmxml']

games

Value:
{'Civilization IV': [16777216, 16927488, 33554443],
 'Emerge': [33619979, 33685515],
 'Loki': [16927488],
 'Megami Tensei: Imagine': [33619979],
 'Oblivion': [16927488],
 'Prison Tycoon': [16927488],
 'Pro Cycling Manager': [16927488],
 'Red Ocean': [16927488],
...

versions

Value:
{'1.0': 16777216,
 '1.2.4b': 16927488,
 '2.0.0.0b': 33554443,
 '2.1.0.0b': 33619979,
 '2.2.0.0b': 33685515}

xml_struct

Value:
[<class 'pyffi.formats.kfm._Animation'>,
 <class 'pyffi.formats.kfm.IntermediateAnim'>,
 <class 'pyffi.formats.kfm.Transition'>,
 <class 'pyffi.formats.kfm._Header'>]