Explorar el Código

randomized manager should not show same screen twice

Thomas Buck hace 8 meses
padre
commit
b29c8e66b4
Se han modificado 2 ficheros con 5 adiciones y 4 borrados
  1. 2
    2
      manager.py
  2. 3
    2
      util.py

+ 2
- 2
manager.py Ver fichero

78
             if self.randomize:
78
             if self.randomize:
79
                 if (self.index % self.step_size) == (self.step_size - 1):
79
                 if (self.index % self.step_size) == (self.step_size - 1):
80
                     # end of "segment", now go to random next segment
80
                     # end of "segment", now go to random next segment
81
-                    new_index = self.index
82
-                    while (new_index == self.index) and (len(self.screens) > self.step_size):
81
+                    new_index = self.index - self.step_size + 1
82
+                    while (new_index == self.index - self.step_size + 1) and (len(self.screens) > self.step_size):
83
                         new_index = int(random.randrange(0, len(self.screens) / self.step_size) * self.step_size)
83
                         new_index = int(random.randrange(0, len(self.screens) / self.step_size) * self.step_size)
84
                     self.index = new_index
84
                     self.index = new_index
85
                 else:
85
                 else:

+ 3
- 2
util.py Ver fichero

91
             ui = TestGUI()
91
             ui = TestGUI()
92
 
92
 
93
             # TODO hard-coded adjustments
93
             # TODO hard-coded adjustments
94
-            from mapper import MapperReduceBrightness
95
-            target = MapperReduceBrightness(ui, i)
94
+            #from mapper import MapperReduceBrightness
95
+            #target = MapperReduceBrightness(ui, i)
96
+            target = ui
96
 
97
 
97
             if targetPlatform == None:
98
             if targetPlatform == None:
98
                 # only print once
99
                 # only print once

Loading…
Cancelar
Guardar