Beispiel #1
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     Database.__init__(self)
     self.gui = Ui_Export()
     self.gui.setupUi(self)
     with open(os.path.join('tmp','comm'),'w') as comm:
         # communicates with export manager
         comm.write('')
     # Calls ---------------------
     self.leagues_tree()
     self.profiles_tree()
     self.bindings()
Beispiel #2
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     Database.__init__(self)
     self.gui = Ui_Export()
     self.gui.setupUi(self)
     with open(os.path.join('tmp', 'comm'), 'w') as comm:
         # communicates with export manager
         comm.write('')
     # Calls ---------------------
     self.leagues_tree()
     self.profiles_tree()
     self.bindings()
Beispiel #3
0
 def leagues_export(self):
     ''' Starts Export of selected leagues'''
     try:
         os.remove(os.path.join('tmp','export'))
     except:
         pass
     expt_name = self.gui.line_export_name.text()
     rows = self.gui.table_leagues.rowCount()
     self.gui.progress_2.setValue(0)
     self.threads = []
     for i in range(0, rows):
         with open(os.path.join('tmp','print'),'w') as export_print_file:
             export_print_file.write('')
             export_print_file.close()
         name = self.gui.table_leagues.item(i, 0).text()
         path = self.gui.table_leagues.item(i, 1).text()
         r_min = self.gui.table_leagues.item(i, 2).text()
         r_max = self.gui.table_leagues.item(i, 3).text()
         mode = 1
         path = str(os.path.join('leagues', path, ''))
         self.gui.progress_2_val = float(i+1) / (rows)*100
         self.gui.progress_2_txt = name
         cmd = (
         path,
         name,
         expt_name,
         int(r_min),
         int(r_max),
         mode
         )
         self.gui.progress_2.setFormat('%p% '+self.gui.progress_2_txt)
         with open(os.path.join('tmp','comm'),'r') as comm:
         # communicates with export manager
             comm_var = comm.readline()
         if comm_var != '':
             self.export.terminate()
             break
         else:
             self.load_csv(cmd[0], cmd[1], cmd[2], cmd[3],
                cmd[4], cmd[5])
             #self.export = DoThread(cmd, self)
             #self.export.start()
         self.gui.button_export.setEnabled(0)
         self.gui.text_export.append(' ')
         self.gui.text_export.append('%s'%(path+name))
         self.gui.text_export.append('-----------------')
         self.gui.progress_2.setValue(self.gui.progress_2_val)
     export_fix = Database()
     export_fix.export_fix(expt_name)
     self.gui.text_export.append('######################')
     self.gui.text_export.append('Done. Export file saved: export/%s'%(expt_name))
     self.gui.button_export.setEnabled(1)
Beispiel #4
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     Database.__init__(self)
     Shared.__init__(self)
     self.odds_level = 100
     self.app = 'selector'
     self.gui = Ui_Selector()
     self.gui.setupUi(self)
     self.gui.tree_selected.headerItem().setText(0, ('Selected'))
     self.filters_tree()
     self.leagues_tree()
     self.bindings()
     try:
         self.filters_load()
     except:
         pass
Beispiel #5
0
 def leagues_export(self):
     ''' Starts Export of selected leagues'''
     try:
         os.remove(os.path.join('tmp', 'export'))
     except:
         pass
     expt_name = self.gui.line_export_name.text()
     rows = self.gui.table_leagues.rowCount()
     self.gui.progress_2.setValue(0)
     self.threads = []
     for i in range(0, rows):
         with open(os.path.join('tmp', 'print'), 'w') as export_print_file:
             export_print_file.write('')
             export_print_file.close()
         name = self.gui.table_leagues.item(i, 0).text()
         path = self.gui.table_leagues.item(i, 1).text()
         r_min = self.gui.table_leagues.item(i, 2).text()
         r_max = self.gui.table_leagues.item(i, 3).text()
         mode = 1
         path = str(os.path.join('leagues', path, ''))
         self.gui.progress_2_val = float(i + 1) / (rows) * 100
         self.gui.progress_2_txt = name
         cmd = (path, name, expt_name, int(r_min), int(r_max), mode)
         self.gui.progress_2.setFormat('%p% ' + self.gui.progress_2_txt)
         with open(os.path.join('tmp', 'comm'), 'r') as comm:
             # communicates with export manager
             comm_var = comm.readline()
         if comm_var != '':
             self.export.terminate()
             break
         else:
             self.load_csv(cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5])
             #self.export = DoThread(cmd, self)
             #self.export.start()
         self.gui.button_export.setEnabled(0)
         self.gui.text_export.append(' ')
         self.gui.text_export.append('%s' % (path + name))
         self.gui.text_export.append('-----------------')
         self.gui.progress_2.setValue(self.gui.progress_2_val)
     export_fix = Database()
     export_fix.export_fix(expt_name)
     self.gui.text_export.append('######################')
     self.gui.text_export.append('Done. Export file saved: export/%s' %
                                 (expt_name))
     self.gui.button_export.setEnabled(1)