コード例 #1
0
ファイル: views.py プロジェクト: LarryHillyer/TexasHoldem
 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()
コード例 #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()
コード例 #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
コード例 #4
0
ファイル: views.py プロジェクト: LarryHillyer/TexasHoldem
 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
コード例 #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
コード例 #6
0
ファイル: views.py プロジェクト: LarryHillyer/TexasHoldem
 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
コード例 #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:
コード例 #8
0
ファイル: views.py プロジェクト: LarryHillyer/TexasHoldem
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: