Add subcommand

rtems tod - prints the time of day.
This commit is contained in:
Dhananjay Balan
2013-08-24 15:08:16 +05:30
committed by Chris Johns
parent a0bf9f207a
commit a245635a2e
4 changed files with 62 additions and 7 deletions

View File

@@ -5,6 +5,31 @@
import threads
import helper
class time_of_day:
'''Manage time of day object'''
def __init__(self, tod):
self.tod = tod
def now(self):
return self.tod['now']
def timer(self):
return self.tod['uptime']
def is_set(self):
return bool(self.tod['is_set'])
def show(self):
print ' Time Of Day'
if not self.is_set():
print ' Application has not set a TOD'
print ' Now:', self.now()
print ' Uptime:', self.timer()
class message_queue:
'''Manage a Supercore message_queue'''