Commit ebdda77e5d10b4eaf233ef7240d07ef7a59d2978

Authored by Quentin Durand
1 parent 7db4ab5f
Exists in dev

small changes in scheduler.py and gitignore

Showing 2 changed files with 13 additions and 5 deletions   Show diff stats
@@ -12,4 +12,5 @@ src/common/migrations/0* @@ -12,4 +12,5 @@ src/common/migrations/0*
12 logs/*.log 12 logs/*.log
13 .idea 13 .idea
14 .idea/workspace.xml 14 .idea/workspace.xml
15 -images_folder  
16 \ No newline at end of file 15 \ No newline at end of file
  16 +images_folder
  17 +Comet/
src/scheduler/Scheduler.py
@@ -110,13 +110,20 @@ class Scheduler(IntervalManagement): @@ -110,13 +110,20 @@ class Scheduler(IntervalManagement):
110 if self.isFirstSchedule(): 110 if self.isFirstSchedule():
111 self.schedule.plan_night_start = self.schedule.plan_start 111 self.schedule.plan_night_start = self.schedule.plan_start
112 else: 112 else:
113 - if self.copyFromPrevious():  
114 - self.schedule.plan_night_start = self.schedule.plan_start 113 + self.copyFromPrevious() #TODO trycatch a faire
  114 + self.schedule.plan_night_start = self.schedule.plan_start
115 115
  116 + # List of sequences (PLANNED, TOBEPLANNED, PENDING)
116 self.sequences = list(Sequence.objects.filter(Q(status=Sequence.PLANNED) | Q(status=Sequence.TOBEPLANNED) 117 self.sequences = list(Sequence.objects.filter(Q(status=Sequence.PLANNED) | Q(status=Sequence.TOBEPLANNED)
117 | Q(status=Sequence.PENDING))) 118 | Q(status=Sequence.PENDING)))
118 - self.sequences = [(sequence, ScheduleHasSequences(sequence=sequence, schedule=self.schedule))  
119 - for sequence in self.sequences] 119 + # List of tuples (sequence, ScheduleHasSequences) for each sequence above and for current schedule
  120 + self.sequences = [
  121 + (
  122 + sequence,
  123 + ScheduleHasSequences(sequence=sequence, schedule=self.schedule)
  124 + )
  125 + for sequence in self.sequences
  126 + ]
120 if DEBUG_FILE: 127 if DEBUG_FILE:
121 self.log(str(len(self.sequences)) + " sequences found") 128 self.log(str(len(self.sequences)) + " sequences found")
122 self.computeSchedule() 129 self.computeSchedule()