-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjobs.py
More file actions
76 lines (56 loc) · 2.04 KB
/
jobs.py
File metadata and controls
76 lines (56 loc) · 2.04 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
import mc
import jobmanager
import time
import xbmc
class ContainerScrollJob(jobmanager.BoxeeJob):
def __init__(self, interval, list):
self.interval = interval
self.list = list
jobmanager.BoxeeJob.__init__(self, "Container Scroll Job", interval)
def process(self):
self.list.ScrollPageDown()
class LocalImageScrollJob(jobmanager.BoxeeJob):
def __init__(self, interval, image, imageArr):
self.interval = interval
self.image = image
self.imageArr = imageArr
self.position = 0
jobmanager.BoxeeJob.__init__(self, "Local Image Scroll Job", interval)
def process(self):
self.image.SetTexture(self.imageArr[self.position])
self.position = self.position + 1
if (self.position == len(self.imageArr)):
self.position = 0
class BreakingNewsJob(jobmanager.BoxeeJob):
def __init__(self, interval, dialogId, duration, imageId, imageArr):
self.interval = interval
self.dialogId = dialogId
self.duration = duration
self.imageArr = imageArr
self.imageId = imageId
self.position = 0
jobmanager.BoxeeJob.__init__(self, "Breaking News Job", interval)
def process(self):
mc.ActivateWindow(self.dialogId)
mc.GetWindow(self.dialogId).GetImage(self.imageId).SetTexture(self.imageArr[self.position])
self.position = self.position + 1
if (self.position == len(self.imageArr)):
self.position = 0
time.sleep(self.duration)
xbmc.executebuiltin("Dialog.Close("+ str(self.dialogId) +")")
class MenuScrollJob(jobmanager.BoxeeJob): ## TODO ##
def __init__(self, interval, size, leftImage, rightImage, topImage):
self.size = size
self.interval = interval
self.leftImage = leftImage
self.rightImage = rightImage
self.topImage = topImage
self.counter = 1
jobmanager.BoxeeJob.__init__(self, "Menu Scroll Job", interval)
def process(self):
self.leftImage.SetTexture(str(self.counter) + "Left.png")
self.rightImage.SetTexture(str(self.counter) + "right.png")
self.topImage.SetTexture(str(self.counter) + "Middle.png")
self.counter = self.counter + 1
if (self.counter > self.size):
self.counter = 1