<s> import os <EOL> import wx <EOL> from wx . lib . pubsub import pub as Publisher <EOL> from odmservices import ServiceManager <EOL> def create ( parent ) : <EOL> return frmDataExport ( parent ) <EOL> [ wxID_FRMDATAEXPORT , wxID_FRMDATAEXPORTBTNOK , wxID_FRMDATAEXPORTBTNCANCEL , <EOL> wxID_FRMDATAEXPORTCHKUTC , wxID_FRMDATAEXPORTCHKSITE , wxID_FRMDATAEXPORTCHKVAR , <EOL> wxID_FRMDATAEXPORTCHKOFFSET , wxID_FRMDATAEXPORTCHKQUAL , wxID_FRMDATAEXPORTCHKSRC , <EOL> wxID_FRMDATAEXPORTCHKQCL , wxID_FRMDATAEXPORTPANEL <EOL> ] = [ wx . NewId ( ) for _init_ctrls in range ( <NUM_LIT:11> ) ] <EOL> class frmDataExport ( wx . Dialog ) : <EOL> def _init_ctrls ( self , prnt ) : <EOL> wx . Dialog . __init__ ( self , id = wxID_FRMDATAEXPORT , name = u'<STR_LIT>' , <EOL> parent = prnt , pos = wx . Point ( <NUM_LIT> , <NUM_LIT> ) , size = wx . Size ( <NUM_LIT> , <NUM_LIT> ) , <EOL> style = wx . DEFAULT_DIALOG_STYLE , title = u'<STR_LIT>' % self . series_id ) <EOL> self . SetClientSize ( wx . Size ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> self . SetFont ( wx . Font ( <NUM_LIT:8> , wx . SWISS , wx . NORMAL , wx . NORMAL , False , u'<STR_LIT>' ) ) <EOL> self . panel = wx . Panel ( id = wxID_FRMDATAEXPORTPANEL , name = '<STR_LIT>' , <EOL> parent = self , pos = wx . Point ( <NUM_LIT:0> , <NUM_LIT:0> ) , size = wx . Size ( <NUM_LIT> , <NUM_LIT> ) , <EOL> style = wx . TAB_TRAVERSAL ) <EOL> self . chkUTC = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKUTC , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT:20> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . chkSite = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKSITE , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . chkVar = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKVAR , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . chkOffset = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKOFFSET , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . chkQual = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKQUAL , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . chkSrc = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKSRC , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . chkQcl = wx . CheckBox ( id = wxID_FRMDATAEXPORTCHKQCL , <EOL> name = u'<STR_LIT>' , label = '<STR_LIT>' , <EOL> parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT:200> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . btnOK = wx . Button ( id = wxID_FRMDATAEXPORTBTNOK , label = u'<STR_LIT:OK>' , <EOL> name = u'<STR_LIT>' , parent = self . panel , pos = wx . Point ( <NUM_LIT:8> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . btnOK . Bind ( wx . EVT_BUTTON , self . OnBtnOKButton , <EOL> id = wxID_FRMDATAEXPORTBTNOK ) <EOL> self . btnCancel = wx . Button ( id = wxID_FRMDATAEXPORTBTNCANCEL , label = u'<STR_LIT>' , <EOL> name = u'<STR_LIT>' , parent = self . panel , pos = wx . Point ( <NUM_LIT:64> , <NUM_LIT> ) , <EOL> size = wx . Size ( <NUM_LIT> , <NUM_LIT> ) , style = <NUM_LIT:0> ) <EOL> self . btnCancel . Bind ( wx . EVT_BUTTON , self . OnBtnCancelButton , <EOL> id = wxID_FRMDATAEXPORTBTNCANCEL ) <EOL> def __init__ ( self , parent , series_id ) : <EOL> self . series_id = series_id <EOL> self . _init_ctrls ( parent ) <EOL> sm = ServiceManager ( ) <EOL> self . export_service = sm . get_export_service ( ) <EOL> def OnBtnOKButton ( self , event ) : <EOL> utc = self . chkUTC . GetValue ( ) <EOL> site = self . chkSite . GetValue ( ) <EOL> var = self . chkVar . GetValue ( ) <EOL> offset = self . chkOffset . GetValue ( ) <EOL> qual = self . chkQual . GetValue ( ) <EOL> src = self . chkSrc . GetValue ( ) <EOL> qcl = self . chkQcl . GetValue ( ) <EOL> dlg = wx . FileDialog ( self , "<STR_LIT>" , '<STR_LIT>' , "<STR_LIT>" , "<STR_LIT>" , wx . SAVE | wx . OVERWRITE_PROMPT ) <EOL> if dlg . ShowModal ( ) == wx . ID_OK : <EOL> full_path = os . path . join ( dlg . GetDirectory ( ) , dlg . GetFilename ( ) ) <EOL> print full_path <EOL> self . export_service . export_series_data ( self . series_id , full_path , utc , site , var , offset , qual , src , qcl ) <EOL> self . Close ( ) <EOL> dlg . Destroy ( ) <EOL> def OnBtnCancelButton ( self , event ) : <EOL> self . Close ( ) </s>
