示例#1
0
            def CMD_selectDB():
                self.mysql_database = self.database_var.get()
                self.tbl_lab = tk.Label(  self.moreMstemWin,text='Database Table name' , **self.LabelOpts )
                self.tbl_lab.grid(row=2, column=0)
                
                all_tables = helper.getTables(self.mysql_database, **self.conn_opts)
                self.datatable_var = tk.StringVar()
                self.datatable_opt = tk.OptionMenu( self.moreMstemWin, self.datatable_var, *all_tables )
                self.datatable_opt.grid( row=2, column=1)
                def CMD_LoadTable():
                    mysql_table = self.datatable_var.get()
#                   read HIPPNET TSV file into pandas
                    self.mstem_datatype, self.mstem_data = helper.mysql_to_dataframe( self.mysql_database, mysql_table , **self.conn_opts  )
                    self.db_lab.destroy()
                    self.database_opt.destroy()
                    self.tbl_lab.destroy()
                    self.datatable_opt.destroy()
                    self.db_b.destroy()
                    self.tbl_b.destroy()
                    
                    self.selectColFromList( self.moreMstemWin,  list(self.mstem_data), 
                                            self.closerInTable, self.more_multi_stem_names)
                
                self.tbl_b = tk.Button( self.moreMstemWin, text='Load Table', relief = tk.RAISED, command=CMD_LoadTable)
                self.tbl_b.grid(row=3,columnspan=2)
示例#2
0
        def CMD_selectDB():
            self.mysql_database = self.database_var.get()
            tk.Label(  self.loadWin,text='Database Table name' , **self.LabelOpts ).grid(row=2, column=0)
            all_tables = helper.getTables(self.mysql_database, **self.conn_opts)
            self.datatable_var = tk.StringVar()
            self.datatable_opt = tk.OptionMenu( self.loadWin, self.datatable_var, *all_tables )
            self.datatable_opt.grid( row=2, column=1)
            def CMD_LoadTable():
                mysql_table = self.datatable_var.get()
                self.Text_DataBase = '%s; %s'%(self.mysql_database, mysql_table)
#               read HIPPNET TSV file into pandas
                self.datatype, self.hippnet_data = helper.mysql_to_dataframe( self.mysql_database, mysql_table, **self.conn_opts   )
                self.hippnet_col_names = list(self.hippnet_data)
                self.loadWin.destroy()
                self._layout() 
                self.DatabaseLoaded['done'] = True
            tk.Button( self.loadWin, text='Load Table', relief = tk.RAISED, command=CMD_LoadTable  ).grid(row=3,columnspan=2)
示例#3
0
            def CMD_selectDB():
                self.mysql_database = self.database_var.get()
                self.tbl_lab = tk.Label(self.moreMstemWin,
                                        text='Database Table name',
                                        **self.LabelOpts)
                self.tbl_lab.grid(row=2, column=0)

                all_tables = helper.getTables(self.mysql_database,
                                              **self.conn_opts)
                self.datatable_var = tk.StringVar()
                self.datatable_opt = tk.OptionMenu(self.moreMstemWin,
                                                   self.datatable_var,
                                                   *all_tables)
                self.datatable_opt.grid(row=2, column=1)

                def CMD_LoadTable():
                    mysql_table = self.datatable_var.get()
                    #                   read HIPPNET TSV file into pandas
                    self.mstem_datatype, self.mstem_data = helper.mysql_to_dataframe(
                        self.mysql_database, mysql_table, **self.conn_opts)
                    self.db_lab.destroy()
                    self.database_opt.destroy()
                    self.tbl_lab.destroy()
                    self.datatable_opt.destroy()
                    self.db_b.destroy()
                    self.tbl_b.destroy()

                    self.selectColFromList(self.moreMstemWin,
                                           list(self.mstem_data),
                                           self.closerInTable,
                                           self.more_multi_stem_names)

                self.tbl_b = tk.Button(self.moreMstemWin,
                                       text='Load Table',
                                       relief=tk.RAISED,
                                       command=CMD_LoadTable)
                self.tbl_b.grid(row=3, columnspan=2)