Package pyffi :: Package spells :: Module kfm
[hide private]
[frames] | no frames]

Source Code for Module pyffi.spells.kfm

 1  """ 
 2  :mod:`pyffi.spells.kfm` ---  NetImmerse/Gamebryo Keyframe Motion (.kfm) spells 
 3  ============================================================================== 
 4   
 5  """ 
 6   
 7  # -------------------------------------------------------------------------- 
 8  # ***** BEGIN LICENSE BLOCK ***** 
 9  # 
10  # Copyright (c) 2007-2011, NIF File Format Library and Tools. 
11  # All rights reserved. 
12  # 
13  # Redistribution and use in source and binary forms, with or without 
14  # modification, are permitted provided that the following conditions 
15  # are met: 
16  # 
17  #    * Redistributions of source code must retain the above copyright 
18  #      notice, this list of conditions and the following disclaimer. 
19  # 
20  #    * Redistributions in binary form must reproduce the above 
21  #      copyright notice, this list of conditions and the following 
22  #      disclaimer in the documentation and/or other materials provided 
23  #      with the distribution. 
24  # 
25  #    * Neither the name of the NIF File Format Library and Tools 
26  #      project nor the names of its contributors may be used to endorse 
27  #      or promote products derived from this software without specific 
28  #      prior written permission. 
29  # 
30  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
31  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
32  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
33  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
34  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
35  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
36  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
37  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
38  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
39  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
40  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
41  # POSSIBILITY OF SUCH DAMAGE. 
42  # 
43  # ***** END LICENSE BLOCK ***** 
44  # -------------------------------------------------------------------------- 
45   
46  import pyffi.spells 
47  import pyffi.spells.check 
48  import pyffi.formats.kfm 
49   
50 -class KfmSpell(pyffi.spells.Spell):
51 """Base class for spells for kfm files."""
52
53 -class SpellDumpAll(KfmSpell):
54 """Dump the whole kfm file.""" 55 56 SPELLNAME = "dump" 57
58 - def dataentry(self):
59 self.toaster.msg(str(self.data)) 60 return False
61
62 -class KfmToaster(pyffi.spells.Toaster):
63 """Base class for kfm toasters.""" 64 FILEFORMAT = pyffi.formats.kfm.KfmFormat 65 66 SPELLS = [ 67 pyffi.spells.check.SpellRead, 68 pyffi.spells.check.SpellReadWrite, 69 SpellDumpAll] 70 71 EXAMPLES = """* check if library can read all files in current directory: 72 73 python kfmtoaster.py check_read ."""
74