def execute(self): from base64 import b64decode from samples.files_as_resource import sample_files_dict #print "samples_dir_files", sample_files_dict.keys() dlg = wx.SingleChoiceDialog(self.context.frame, 'Choice:', 'Choose a Sample Uml Diagram', sample_files_dict.keys(), wx.CHOICEDLG_STYLE) if dlg.ShowModal() == wx.ID_OK: #self.log.WriteText('You selected: %s\n' % dlg.GetStringSelection()) k = dlg.GetStringSelection() self.filepath = "(Sample %s)" % k s = b64decode(sample_files_dict[k]) self.load_model_from_text_and_build_shapes(s) dlg.Destroy()
def execute(self): from base64 import b64decode from samples.files_as_resource import sample_files_dict #print "samples_dir_files", sample_files_dict.keys() dlg = wx.SingleChoiceDialog( self.context.frame, 'Choice:', 'Choose a Sample Uml Diagram', sample_files_dict.keys(), wx.CHOICEDLG_STYLE ) if dlg.ShowModal() == wx.ID_OK: #self.log.WriteText('You selected: %s\n' % dlg.GetStringSelection()) k = dlg.GetStringSelection() self.filepath = "(Sample %s)" % k s = b64decode(sample_files_dict[k]) self.load_model_from_text_and_build_shapes(s) dlg.Destroy()