<s> """<STR_LIT>""" <EOL> from construct import * <EOL> record_type = Enum ( ULInt32 ( "<STR_LIT>" ) , <EOL> ABORTPATH = <NUM_LIT> , <EOL> ANGLEARC = <NUM_LIT> , <EOL> ARC = <NUM_LIT> , <EOL> ARCTO = <NUM_LIT> , <EOL> BEGINPATH = <NUM_LIT> , <EOL> BITBLT = <NUM_LIT> , <EOL> CHORD = <NUM_LIT> , <EOL> CLOSEFIGURE = <NUM_LIT> , <EOL> CREATEBRUSHINDIRECT = <NUM_LIT> , <EOL> CREATEDIBPATTERNBRUSHPT = <NUM_LIT> , <EOL> CREATEMONOBRUSH = <NUM_LIT> , <EOL> CREATEPALETTE = <NUM_LIT> , <EOL> CREATEPEN = <NUM_LIT> , <EOL> DELETEOBJECT = <NUM_LIT> , <EOL> ELLIPSE = <NUM_LIT> , <EOL> ENDPATH = <NUM_LIT> , <EOL> EOF = <NUM_LIT> , <EOL> EXCLUDECLIPRECT = <NUM_LIT> , <EOL> EXTCREATEFONTINDIRECTW = <NUM_LIT> , <EOL> EXTCREATEPEN = <NUM_LIT> , <EOL> EXTFLOODFILL = <NUM_LIT> , <EOL> EXTSELECTCLIPRGN = <NUM_LIT> , <EOL> EXTTEXTOUTA = <NUM_LIT> , <EOL> EXTTEXTOUTW = <NUM_LIT> , <EOL> FILLPATH = <NUM_LIT> , <EOL> FILLRGN = <NUM_LIT> , <EOL> FLATTENPATH = <NUM_LIT> , <EOL> FRAMERGN = <NUM_LIT> , <EOL> GDICOMMENT = <NUM_LIT> , <EOL> HEADER = <NUM_LIT:1> , <EOL> INTERSECTCLIPRECT = <NUM_LIT:30> , <EOL> INVERTRGN = <NUM_LIT> , <EOL> LINETO = <NUM_LIT> , <EOL> MASKBLT = <NUM_LIT> , <EOL> MODIFYWORLDTRANSFORM = <NUM_LIT> , <EOL> MOVETOEX = <NUM_LIT> , <EOL> OFFSETCLIPRGN = <NUM_LIT> , <EOL> PAINTRGN = <NUM_LIT> , <EOL> PIE = <NUM_LIT> , <EOL> PLGBLT = <NUM_LIT> , <EOL> POLYBEZIER = <NUM_LIT:2> , <EOL> POLYBEZIER16 = <NUM_LIT> , <EOL> POLYBEZIERTO = <NUM_LIT:5> , <EOL> POLYBEZIERTO16 = <NUM_LIT> , <EOL> POLYDRAW = <NUM_LIT> , <EOL> POLYDRAW16 = <NUM_LIT> , <EOL> POLYGON = <NUM_LIT:3> , <EOL> POLYGON16 = <NUM_LIT> , <EOL> POLYLINE = <NUM_LIT:4> , <EOL> POLYLINE16 = <NUM_LIT> , <EOL> POLYLINETO = <NUM_LIT:6> , <EOL> POLYLINETO16 = <NUM_LIT> , <EOL> POLYPOLYGON = <NUM_LIT:8> , <EOL> POLYPOLYGON16 = <NUM_LIT> , <EOL> POLYPOLYLINE = <NUM_LIT:7> , <EOL> POLYPOLYLINE16 = <NUM_LIT> , <EOL> POLYTEXTOUTA = <NUM_LIT> , <EOL> POLYTEXTOUTW = <NUM_LIT> , <EOL> REALIZEPALETTE = <NUM_LIT> , <EOL> RECTANGLE = <NUM_LIT> , <EOL> RESIZEPALETTE = <NUM_LIT> , <EOL> RESTOREDC = <NUM_LIT> , <EOL> ROUNDRECT = <NUM_LIT> , <EOL> SAVEDC = <NUM_LIT> , <EOL> SCALEVIEWPORTEXTEX = <NUM_LIT> , <EOL> SCALEWINDOWEXTEX = <NUM_LIT:32> , <EOL> SELECTCLIPPATH = <NUM_LIT> , <EOL> SELECTOBJECT = <NUM_LIT> , <EOL> SELECTPALETTE = <NUM_LIT> , <EOL> SETARCDIRECTION = <NUM_LIT> , <EOL> SETBKCOLOR = <NUM_LIT> , <EOL> SETBKMODE = <NUM_LIT> , <EOL> SETBRUSHORGEX = <NUM_LIT> , <EOL> SETCOLORADJUSTMENT = <NUM_LIT> , <EOL> SETDIBITSTODEVICE = <NUM_LIT> , <EOL> SETMAPMODE = <NUM_LIT> , <EOL> SETMAPPERFLAGS = <NUM_LIT:16> , <EOL> SETMETARGN = <NUM_LIT> , <EOL> SETMITERLIMIT = <NUM_LIT> , <EOL> SETPALETTEENTRIES = <NUM_LIT:50> , <EOL> SETPIXELV = <NUM_LIT:15> , <EOL> SETPOLYFILLMODE = <NUM_LIT> , <EOL> SETROP2 = <NUM_LIT:20> , <EOL> SETSTRETCHBLTMODE = <NUM_LIT> , <EOL> SETTEXTALIGN = <NUM_LIT> , <EOL> SETTEXTCOLOR = <NUM_LIT> , <EOL> SETVIEWPORTEXTEX = <NUM_LIT:11> , <EOL> SETVIEWPORTORGEX = <NUM_LIT:12> , <EOL> SETWINDOWEXTEX = <NUM_LIT:9> , <EOL> SETWINDOWORGEX = <NUM_LIT:10> , <EOL> SETWORLDTRANSFORM = <NUM_LIT> , <EOL> STRETCHBLT = <NUM_LIT> , <EOL> STRETCHDIBITS = <NUM_LIT> , <EOL> STROKEANDFILLPATH = <NUM_LIT> , <EOL> STROKEPATH = <NUM_LIT:64> , <EOL> WIDENPATH = <NUM_LIT> , <EOL> _default_ = Pass , <EOL> ) <EOL> generic_record = Struct ( "<STR_LIT>" , <EOL> record_type , <EOL> ULInt32 ( "<STR_LIT>" ) , <EOL> Union ( "<STR_LIT>" , <EOL> Field ( "<STR_LIT>" , lambda ctx : ctx . _ . record_size - <NUM_LIT:8> ) , <EOL> Array ( lambda ctx : ( ctx . _ . record_size - <NUM_LIT:8> ) // <NUM_LIT:4> , ULInt32 ( "<STR_LIT>" ) ) <EOL> ) , <EOL> ) <EOL> header_record = Struct ( "<STR_LIT>" , <EOL> Const ( record_type , "<STR_LIT>" ) , <EOL> ULInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> Const ( ULInt32 ( "<STR_LIT>" ) , <NUM_LIT> ) , <EOL> ULInt32 ( "<STR_LIT:version>" ) , <EOL> ULInt32 ( "<STR_LIT:size>" ) , <EOL> ULInt32 ( "<STR_LIT>" ) , <EOL> ULInt16 ( "<STR_LIT>" ) , <EOL> Padding ( <NUM_LIT:2> ) , <EOL> ULInt32 ( "<STR_LIT>" ) , <EOL> ULInt32 ( "<STR_LIT>" ) , <EOL> ULInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> SLInt32 ( "<STR_LIT>" ) , <EOL> Pointer ( lambda ctx : ctx . description_offset , <EOL> StringAdapter ( <EOL> Array ( lambda ctx : ctx . description_size , <EOL> Field ( "<STR_LIT:description>" , <NUM_LIT:2> ) <EOL> ) <EOL> ) <EOL> ) , <EOL> Padding ( lambda ctx : ctx . record_size - <NUM_LIT> ) , <EOL> ) <EOL> emf_file = Struct ( "<STR_LIT>" , <EOL> header_record , <EOL> Array ( lambda ctx : ctx . header_record . num_of_records - <NUM_LIT:1> , <EOL> generic_record <EOL> ) , <EOL> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> obj = emf_file . parse_stream ( open ( "<STR_LIT>" , "<STR_LIT:rb>" ) ) <EOL> print obj </s>
