示例#1
0
文件: rpc.py 项目: skarphed/skarphed
 def getCurrentTemplate(self, params):
     if Template.is_template_installed():
         current_template = Template.get_current_template()
         return {'name': current_template.get_name(),
                 'description': current_template.get_description(),
                 'author': current_template.get_author()}
     else:
         return {'name': '(No Template)',
                 'description': '(Currently no Template Installed)',
                 'author': '(No Author)',}
示例#2
0
文件: rpc.py 项目: skarphed/skarphed
    def installTemplate(self, params):
        templatedata = base64.b64decode(params[0])

        #TODO check for permission

        errorlog = Template.install_from_data(templatedata)
        return errorlog
示例#3
0
文件: rpc.py 项目: skarphed/skarphed
 def refreshAvailableTemplates(self, params):
     templates = Template.fetch_templates_for_gui()
     ret = [{
             'id':t['id'],
             'name':t['name'],
             'description':t['description'],
             'author':t['author']
           } for t in templates]
     return ret
示例#4
0
文件: rpc.py 项目: skarphed/skarphed
 def installTemplateFromRepo(self, params):
     repo_template_id = int(params[0])
     errorlog = Template.install_from_repo(repo_template_id)
     return errorlog