Api doc base

This commit is contained in:
Ruud
2012-02-21 17:16:02 +01:00
parent adc755dbd5
commit 7df24643ac
11 changed files with 280 additions and 22 deletions
+11 -3
View File
@@ -24,9 +24,17 @@ class Core(Plugin):
shutdown_started = False
def __init__(self):
addApiView('app.shutdown', self.shutdown)
addApiView('app.restart', self.restart)
addApiView('app.available', self.available)
addApiView('app.shutdown', self.shutdown, docs = {
'desc': 'Shutdown the app.',
'return': {'type': 'string: shutdown'}
})
addApiView('app.restart', self.restart, docs = {
'desc': 'Restart the app.',
'return': {'type': 'string: restart'}
})
addApiView('app.available', self.available, docs = {
'desc': 'Check if app available.'
})
addEvent('app.crappy_shutdown', self.crappyShutdown)
addEvent('app.crappy_restart', self.crappyRestart)
+18 -2
View File
@@ -29,9 +29,25 @@ class Updater(Plugin):
addEvent('app.load', self.check)
addApiView('updater.info', self.getInfo)
addApiView('updater.info', self.getInfo, docs = {
'desc': 'Get updater information',
'return': {
'type': 'object',
'example': """
{
'repo_name': "Name of used repository",
'last_check': "last checked for update",
'update_version': "available update version or empty",
'version': current_cp_version
}
"""
}
})
addApiView('updater.update', self.doUpdateView)
addApiView('updater.check', self.checkView)
addApiView('updater.check', self.checkView, docs = {
'desc': 'Check for available update',
'return': {'type': 'see updater.info'}
})
def getInfo(self):