def dump(apppath, modulepath): """Dump terminology data to Python module. apppath : str -- name or path of application modulepath : str -- path to generated module """ tables = buildtablesforaetes(getaete(findapp.byname(apppath))) atts = zip(('classes', 'enums', 'properties', 'elements', 'commands'), tables) f = file(expanduser(modulepath), 'w') print >> f, 'version = 1.1' print >> f, 'path = %r' % apppath for key, value in atts: if key[0] != '_': print >> f, '\n%s = \\\n' % key, pprint(value, f) f.close()
def dump(apppath, modulepath): """Dump terminology data to Python module. apppath : str -- name or path of application modulepath : str -- path to generated module """ apppath = findapp.byname(apppath) aetes = [aete.data for aete in getaete(apppath) if isinstance(aete, AEDesc) and aete.type == 'aete'] tables = buildtablesforaetes(aetes) atts = zip(('classes', 'enums', 'properties', 'elements', 'commands'), tables) f = file(modulepath, 'w') print >> f, 'version = 1.1' print >> f, 'path = %r' % apppath for key, value in atts: if key[0] != '_': print >> f, '\n%s = \\' % key pprint(value, f) f.close()