-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram live code KEEP.py
More file actions
636 lines (415 loc) · 33.1 KB
/
program live code KEEP.py
File metadata and controls
636 lines (415 loc) · 33.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
for program_stop_clock, program_width, program_id in izip_longest(self.program_finished_clock, self.program_width, self.program_id, fillvalue=''):
print "program_stop_clock"
print program_stop_clock
current_time = int(time.strftime("%M"))
program_finished = program_stop_clock
programX = self.getControl(int(program_id)).getX()
nextprogram = int(program_id) + 1
nextprogramX = self.getControl(int(nextprogram)).getX()
nextprogram_width = self.getControl(int(nextprogram)).getWidth()
nextprogram1 = int(nextprogram) + 1
nextprogram1X = self.getControl(int(nextprogram1)).getX()
nextprogram1_width = self.getControl(int(nextprogram1)).getWidth()
nextprogram2 = int(nextprogram1) + 1
nextprogram2X = self.getControl(int(nextprogram2)).getX()
nextprogram2_width = self.getControl(int(nextprogram2)).getWidth()
nextprogram3 = int(nextprogram2) + 1
nextprogram3X = self.getControl(int(nextprogram3)).getX()
nextprogram3_width = self.getControl(int(nextprogram3)).getWidth()
pos_Y = self.getControl(int(program_id)).getY()
print program_finished
if int(programX) == 375:
if programX == 375 and program_width == 342:
if nextprogramX == 1073:
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
elif programX == 375 and program_width == 626:
if nextprogramX != 1008:
self.getControl(int(nextprogram)).setPosition(1008, int(pos_Y))
elif nextprogramX == 1008:
self.getControl(int(nextprogram)).setPosition(1007, int(pos_Y))
elif programX == 375 and program_width == 692:
if nextprogramX == 1073:
program_width = 691
self.getControl(int(program_id)).setWidth(program_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif nextprogramX != 1073:
program_width = 691
self.getControl(int(program_id)).setWidth(program_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
if program_stop_time == epg_time_1:
print "here 1"
if program_finished == '00':
if programX == 375 and program_width >= 342:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(program_id)).setVisible(False)
self.getControl(int(program_id)).setPosition(int(pos_X) - 350, int(pos_Y))
self.getControl(int(nextprogram)).setPosition(375, int(pos_Y))
elif program_finished == '30':
if programX == 375 and program_width >= 342:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(program_id)).setVisible(False)
self.getControl(int(program_id)).setPosition(int(pos_X) - 350, int(pos_Y))
self.getControl(int(nextprogram)).setPosition(375, int(pos_Y))
if nextprogram_width == 342:
self.getControl(int(nextprogram1)).setPosition(724, int(pos_Y))
elif nextprogram_width == 692:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
elif program_stop_time == epg_time_2:
print "here 2"
if program_finished == '00':
if program_stop_time == epg_time_2:
if programX == 375 and program_width == 692:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
if nextprogram_width == 342:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
elif nextprogram_width == 456:
self.getControl(int(nextprogram1)).setPosition(1188, int(pos_Y))
elif programX == 375 and program_width > 342:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
if nextprogram_width == 342:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
elif program_finished >= '15' and program_finished <= '17':
if programX == 375 and program_width == 692:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
#if nextprograms_width == 342:
#if nextprogram_width == 286 and nextprograms_width == 59:
#nextprogram_width = 276
#self.getControl(int(nextprogram)).setWidth(nextprogram_width)
elif program_finished == '25':
if programX == 375 and program_width == 456:
programs_width = 287
self.getControl(int(program_id)).setWidth(programs_width)
elif program_finished == '30':
if programX == 375 and program_width == 342:
print program_finished
elif program_stop_time > epg_time_1 and program_stop_time < epg_time_2 or program_stop_time > epg_time_2:
print "here 3"
if program_finished == '00':
if program_stop_time == epg_time_1:
if programX == 375 and program_width <= 741:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(program_id)).setVisible(False)
self.getControl(int(program_id)).setPosition(int(pos_X) - 350, int(pos_Y))
self.getControl(int(nextprogram)).setPosition(375, int(pos_Y))
if nextprogram_width == 342:
if nextprogram1X != 724:
self.getControl(int(nextprogram1)).setPosition(724, int(pos_Y))
elif program_stop_time == epg_time_2 or program_stop_time > epg_time_2:
if programX == 375 and program_width >= 741:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
if nextprogram_width == 342:
if nextprogram1X != 1073:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
elif program_stop_time == epg_time_3:
if programX == 375 and program_width >= 741:
programs_width = 692
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif program_finished == '05':
if program_stop_time > epg_time_1:
if programX == 375 and program_width <= 741:
programs_width = 59
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(440, int(pos_Y))
if nextprogram_width == 396:
self.getControl(int(nextprogram1)).setPosition(842, int(pos_Y))
elif nextprogram_width == 626:
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif program_finished == '10':
if program_stop_time > epg_time_3:
if programX == 375 and program_width >= 1037:
programs_width = 798
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1180, int(pos_Y))
elif program_finished == '20':
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if programX == 375 and program_width >= 232:
programs_width = 232
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(program_id)).setVisible(False)
self.getControl(int(program_id)).setPosition(int(pos_X) - 350, int(pos_Y))
self.getControl(int(nextprogram)).setPosition(375, int(pos_Y))
if nextprogram_width == 692:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
#elif programX == 375 and program_width >= 342:
#programs_width = 232
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(614, int(pos_Y))
elif program_finished == '25':
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if programX == 375 and program_width >= 456:
programs_width = 278
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(660, int(pos_Y))
if nextprogram_width == 456:
self.getControl(int(nextprogram1)).setPosition(1124, int(pos_Y))
elif program_finished == '30':
if program_stop_time == epg_time_3:
if programX == 375 and program_width >= 1038:
programs_width = 692
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif program_finished == '35':
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if int(current_time) >= 0 and int(current_time) < 29:
if programX == 375 and program_width >= 741:
programs_width = 399
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(780, int(pos_Y))
if nextprogram_width == 286:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
#self.getControl(int(nextprogram1)).setVisible(True)
elif int(current_time) >= 30 and int(current_time) < 59:
if programX == 375 and program_width >= 741:
self.getControl(int(program_id)).setVisible(False)
self.getControl(int(program_id)).setPosition(int(pos_X) - 350, int(pos_Y))
self.getControl(int(nextprogram)).setPosition(375, int(pos_Y))
if nextprogram_width == 286:
programs_width = 342
self.getControl(int(nextprogram)).setWidth(programs_width)
self.getControl(int(nextprogram1)).setPosition(724, int(pos_Y))
self.getControl(int(nextprogram1)).setVisible(True)
elif program_stop_time > epg_time_3:
if programX == 375 and program_width >= 741:
programs_width = 750
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1132, int(pos_Y))
elif program_finished == '40':
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if programX == 375 and program_width >= 342:
programs_width = 117
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(499, int(pos_Y))
if nextprogram_width == 515:
self.getControl(int(nextprogram1)).setPosition(1020, int(pos_Y))
elif program_finished == '45':
print "hello chris"
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if programX == 375 and program_width >= 342:
programs_width = 167
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(549, int(pos_Y))
if nextprogram_width == 515:
programs_width = 517
self.getControl(int(nextprogram)).setWidth(programs_width)
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
elif program_stop_time > epg_time_2 and program_stop_time < epg_time_3:
if programX == 375 and program_width >= 342:
programs_width = 516
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(897, int(pos_Y))
#if nextprogram_width == 515:
#programs_width = 517
#self.getControl(int(nextprogram)).setWidth(programs_width)
#self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
elif program_stop_time == epg_time_3:
if programX == 375 and program_width >= 692:
programs_width = 691
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif program_finished == '50':
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if programX == 375 and program_width == 227 and nextprogram_width == 117:
programs_width = 224
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(606, int(pos_Y))
if nextprogram_width == 117:
programs_width = 111
self.getControl(int(nextprogram)).setWidth(programs_width)
self.getControl(int(nextprogram1)).setPosition(724, int(pos_Y))
elif programX == 375 and program_width >= 626:
programs_width = 227
self.getControl(int(program_id)).setWidth(programs_width)
if nextprogram_width == 117:
programs_width = 112
self.getControl(int(nextprogram)).setWidth(programs_width)
elif program_finished == '55':
if program_stop_time > epg_time_1 and program_stop_time < epg_time_2:
if programX == 375 and program_width >= 342:
if nextprogram_width == 59:
programs_width = 277
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(659, int(pos_Y))
if nextprogram1X == 1073:
self.getControl(int(nextprogram1)).setPosition(724, int(pos_Y))
else:
programs_width = 283
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(664, int(pos_Y))
#if program_length == 798:
#prog_width = 692
#self.getControl(int(program_id)).setWidth(prog_width)
elif program_stop_time > epg_time_2 and program_stop_time < epg_time_3 or program_stop_time > epg_time_2 and program_stop_time > epg_time_3:
print "here 4"
if program_finished == '00':
if programX == 375 and program_width == 342:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
elif programX == 375 and program_width >= 515:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(724, int(pos_Y))
elif program_finished == '10':
if programX == 375 and program_width <= 692:
programs_width = 456
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(837, int(pos_Y))
elif program_finished == '20':
if programX == 375 and program_width >= 1038:
programs_width = 577
self.getControl(int(program_id)).setWidth(programs_width)
elif program_finished == '25':
if programX == 375 and program_width >= 969:
programs_width = 627
self.getControl(int(program_id)).setWidth(programs_width)
if nextprogramX != 949:
self.getControl(int(nextprogram)).setPosition(1008, int(pos_Y))
elif program_finished == '30':
if programX == 375 and program_width >= 1038:
programs_width = 342
self.getControl(int(program_id)).setWidth(programs_width)
elif program_finished == '35':
if programX == 375 and program_width >= 1038:
programs_width = 399
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(780, int(pos_Y))
if nextprogram_width == 286:
self.getControl(int(nextprogram1)).setPosition(1073, int(pos_Y))
#self.getControl(int(nextprogram1)).setVisible(True)
elif program_finished == '40':
if programX == 375 and program_width > 692:
programs_width = 456
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(838, int(pos_Y))
elif program_finished == '45':
if programX == 375 and program_width >= 691:
programs_width = 577
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(958, int(pos_Y))
#if int(current_time) >= 00 and int(current_time) < 29:
#if program_finished == '05':
#if program_width >= 515:
#programs_width = 396
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(779, int(pos_Y))
#elif program_finished == '10':
#if program_width >= 692:
#programs_width = 456
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_finished == '15':
#if program_width == 692:
#programs_width = 515
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_width == 515:
#programs_width = 167
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(549, int(pos_Y))
#elif program_width == 567:
#programs_width = 167
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(838, int(pos_Y))
#elif program_finished == '20':
#if program_width == 692:
#programs_width = 567
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_finished == '30':
#if program_width >= 515:
#prog_width = 342
#self.getControl(int(program_id)).setWidth(prog_width)
#if nextprograms_width == 342:
#if nextprogram_width == 286 and nextprograms_width == 59:
#programs_width = 276
#self.getControl(int(nextprogram)).setWidth(programs_width)
#elif program_finished == '45':
#if program_width >= 692:
#programs_width = 515
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(897, int(pos_Y))
#elif program_finished == '50':
#if program_width == 1083:
#programs_width = 741
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_width == 1368:
#programs_width = 1026
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_width == 692:
#programs_width = 577
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_width == 626:
#programs_width = 286
#self.getControl(int(program_id)).setWidth(programs_width)
#elif program_width == 342:
#programs_width = 232
#self.getControl(int(program_id)).setWidth(programs_width)
#if int(current_time) >= 30 and int(current_time) < 59:
#if program_finished == '15':
#if program_width >= 567:
#programs_width = 515
#self.getControl(int(program_id)).setWidth(programs_width)
#self.getControl(int(nextprogram)).setPosition(897, int(pos_Y))
#if program_stop_time > epg_time_3:
#if program_finished == '00':
#if program_width == 1368:
#programs_width = 1026
#self.getControl(int(program_id)).setWidth(programs_width)
elif program_stop_time == epg_time_3 or program_stop_time > epg_time_3:
print "here 5"
if program_finished == '00':
if programX == 375 and program_width > 1038:
programs_width = 691
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif program_stop_time > epg_time_3:
print "here 6"
if program_finished == '05':
if programX == 375 and program_width > 692:
programs_width = 751
self.getControl(int(program_id)).setWidth(programs_width)
elif program_finished == '10':
if programX == 375 and program_width >= 1037:
programs_width = 798
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1180, int(pos_Y))
elif program_finished == '25':
if programX == 375 and program_width == 567:
programs_width = 278
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(660, int(pos_Y))
if nextprogram_width == 456:
self.getControl(int(nextprogram1)).setPosition(1124, int(pos_Y))
elif program_finished == '45':
if programX == 375 and program_width == 741:
programs_width = 167
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(549, int(pos_Y))
elif program_finished == '55':
if programX == 375 and program_width == 1311:
programs_width = 976
self.getControl(int(program_id)).setWidth(programs_width)
elif program_stop_time == epg_time_3:
print "here 7"
if program_finished == '00':
if programX == 375 and program_width == 692:
if nextprogramX != 1073:
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif programX == 375 and program_width >= 1038:
programs_width = 691
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))
elif program_finished == '30':
if programX == 375 and program_width >= 1038:
programs_width = 692
self.getControl(int(program_id)).setWidth(programs_width)
self.getControl(int(nextprogram)).setPosition(1073, int(pos_Y))