show min running %
authorCezary Czaplewski <czarek@chem.univ.gda.pl>
Wed, 31 Jan 2018 17:59:54 +0000 (18:59 +0100)
committerCezary Czaplewski <czarek@chem.univ.gda.pl>
Wed, 31 Jan 2018 17:59:54 +0000 (18:59 +0100)
django_simple/todo/views.py

index 45741f2..0e61389 100644 (file)
@@ -918,6 +918,20 @@ def refresh_done0(task):
       elif os.path.isfile(task.jobdirname+'/file_GB000.stat') and not task.done:
          if (task.type=='min'):
            task.running =1
+           with open(task.jobdirname+'/file.out_GB000', 'r') as f:
+              line=''
+              for line in f:
+                pass
+              if line != '':
+                last = line.split()[0]
+              else:
+                last = 0
+           try:
+              task.running=int(1+int(last)*100.0/task.min_maxmin)
+           except:
+              pass
+           if task.running>100:
+              task.running=100
          else:
            with open(task.jobdirname+'/file_GB000.stat', 'r') as f:
               line=''