-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtask.py
More file actions
executable file
·38 lines (28 loc) · 740 Bytes
/
Copy pathtask.py
File metadata and controls
executable file
·38 lines (28 loc) · 740 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*
import time
class Task(object):
def __init__(self, name):
self.name = name
self.period = None
self.d = None
self.device = None
self.applicationid = None
self.version_name = None
self.pid = None
self.interval = None
self.output = None
self.info_list = set([])
def execute(self):
pass
def add_info(self, info):
self.info_list.add(info)
info.task = self
def set_device(self, d):
self.d = d
class RandomTask(Task):
def __init__(self, name):
super().__init__(name)
self.duration = 0.0
def execute(self):
time.sleep(self.duration)