Exemple #1
0
 def reset_dispatch(self, pk):
     try:
         ds1 = dispatcher_status.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()
             print('save')
     except dispatcher_status.DoesNotExist:
         ds1 = dispatcher_status.objects.all().delete()
         ds1 = dispatcher_status(status = 'Stopped')
         ds1.id = 1
         ds1.save()
Exemple #2
0
 def reset_dispatch(self, pk):
     try:
         ds1 = dispatcher_status.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()
             print('save')
     except dispatcher_status.DoesNotExist:
         ds1 = dispatcher_status.objects.all().delete()
         ds1 = dispatcher_status(status='Stopped')
         ds1.id = 1
         ds1.save()
Exemple #3
0
 def get_job_object(self, pk):
     try:
         ds1 = dispatcher_status.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()
         return ds1
     except:
         ds1 = dispatcher_status.objects.all().delete()
         ds1 = dispatcher_status(status='Stopped')
         ds1.id = 1
         ds1.save()
         return ds1
Exemple #4
0
 def get_job_object(self, pk):
     try:
         ds1 = dispatcher_status.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()           
         return ds1
     except:
         ds1 = dispatcher_status.objects.all().delete()
         ds1 = dispatcher_status(status = 'Stopped')
         ds1.id = 1
         ds1.save()
         return ds1
Exemple #5
0
 def set_object(self):
     try:
         ds1 = dispatcher_status.objects.get(pk=1)
         if ds1.status != 'Reset':
             ds1.status = 'Reset'
             ds1.save()
     except:
         ds1 = dispatcher_status.objects.all().delete()
         ds1 = dispatcher_status(status='Reset')
         ds1.id = 1
         ds1.save()
     try:
         sj1 = Simulation_Job.objects.get(status='running')
         sj1.status = 'aborted'
         sj1.save()
     except:
         pass
     return
Exemple #6
0
 def set_object(self):
     try:
         ds1 = dispatcher_status.objects.get(pk=1)
         if ds1.status != 'Reset':
             ds1.status = 'Reset'
             ds1.save()
     except:
         ds1 = dispatcher_status.objects.all().delete()
         ds1 = dispatcher_status(status = 'Reset')
         ds1.id = 1
         ds1.save()      
     try:
         sj1 = Simulation_Job.objects.get(status='running')
         sj1.status ='aborted'
         sj1.save()
     except:
         pass
     return
Exemple #7
0
job_script2 = 'Job_Dispatcher2.py'

analyze_script = 'Texas_Holdem_AnalyzeStats.py'

sim_dir = root_dir + app_dir + sim_script_dir

try:
    ds1 = dispatcher_status.objects.get(pk=1)
    if ds1.status == 'Reset':
        ds1.status = 'Stopped'
        ds1.job_name = ''
        ds1.save()
        print('save')
except dispatcher_status.DoesNotExist:
    ds1 = dispatcher_status.objects.all().delete()
    ds1 = dispatcher_status(status='Stopped')
    dsd = ds1.id
    ds1.id = 1
    ds1.save()


class index(APIView):
    def reset_dispatch(self, pk):
        try:
            ds1 = dispatcher_status.objects.get(pk=pk)
            if ds1.status == 'Reset':
                ds1.status = 'Stopped'
                ds1.job_name = ''
                ds1.save()
                print('save')
        except dispatcher_status.DoesNotExist:
Exemple #8
0
job_script2 = 'Job_Dispatcher2.py'

analyze_script = 'Texas_Holdem_AnalyzeStats.py'

sim_dir = root_dir + app_dir + sim_script_dir

try:
    ds1 = dispatcher_status.objects.get(pk=1)
    if ds1.status == 'Reset':
        ds1.status = 'Stopped'
        ds1.job_name = ''
        ds1.save()
        print('save')
except dispatcher_status.DoesNotExist:
    ds1 = dispatcher_status.objects.all().delete()
    ds1 = dispatcher_status(status = 'Stopped')
    dsd = ds1.id
    ds1.id = 1
    ds1.save()
    
class index(APIView):
    
    def reset_dispatch(self, pk):
        try:
            ds1 = dispatcher_status.objects.get(pk=pk)
            if ds1.status == 'Reset':
                ds1.status = 'Stopped'
                ds1.job_name = ''
                ds1.save()
                print('save')
        except dispatcher_status.DoesNotExist: