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

Source Code for Module pyffi.spells.cgf.dump

 1  """Spells for dumping particular blocks.""" 
 2   
 3  # -------------------------------------------------------------------------- 
 4  # ***** BEGIN LICENSE BLOCK ***** 
 5  # 
 6  # Copyright (c) 2007-2011, NIF File Format Library and Tools. 
 7  # All rights reserved. 
 8  # 
 9  # Redistribution and use in source and binary forms, with or without 
10  # modification, are permitted provided that the following conditions 
11  # are met: 
12  # 
13  #    * Redistributions of source code must retain the above copyright 
14  #      notice, this list of conditions and the following disclaimer. 
15  # 
16  #    * Redistributions in binary form must reproduce the above 
17  #      copyright notice, this list of conditions and the following 
18  #      disclaimer in the documentation and/or other materials provided 
19  #      with the distribution. 
20  # 
21  #    * Neither the name of the NIF File Format Library and Tools 
22  #      project nor the names of its contributors may be used to endorse 
23  #      or promote products derived from this software without specific 
24  #      prior written permission. 
25  # 
26  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
27  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
28  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
29  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
30  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
31  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
32  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
33  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
34  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
35  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
36  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
37  # POSSIBILITY OF SUCH DAMAGE. 
38  # 
39  # ***** END LICENSE BLOCK ***** 
40  # -------------------------------------------------------------------------- 
41   
42  from pyffi.formats.cgf import CgfFormat 
43  import pyffi.spells.cgf 
44   
45 -def dumpBlock(chunk):
46 # XXX figure out how to get the version 47 #print('chunk %3i (%s version 0x%04X)' 48 # % (i, chunk.__class__.__name__, version)) 49 return str(chunk)
50
51 -class SpellDumpAll(pyffi.spells.cgf.CgfSpell):
52 """Dump the whole file.""" 53 54 SPELLNAME = "dump" 55
56 - def branchentry(self, branch):
57 # dump it 58 self.toaster.msg(dumpBlock(branch)) 59 # continue recursion 60 return True
61