Don't take unnecessary kwargs in exposed methods

This commit is contained in:
Sunil Mohan Adapa 2014-06-06 20:37:48 +05:30
parent ef493ae243
commit 3e32715a55
4 changed files with 5 additions and 19 deletions

View File

@ -45,10 +45,8 @@ class Firewall(PagePlugin):
@cherrypy.expose
@require()
def index(self, **kwargs):
def index(self):
"""Serve introcution page"""
del kwargs # Unused
if not self.get_installed_status():
return util.render_template(template='firewall',
title=_("Firewall"),

View File

@ -58,10 +58,8 @@ class Packages(PagePlugin):
@cherrypy.expose
@require()
def index(self, *args, **kwargs):
def index(self, **kwargs):
"""Serve the form"""
del args # Unused
status = self.get_status()
form = None

View File

@ -46,10 +46,8 @@ class PageKite(PagePlugin):
@staticmethod
@cherrypy.expose
@require()
def index(**kwargs):
def index():
"""Serve introdution page"""
del kwargs # Unused
menu = {'title': _('PageKite'),
'items': [{'url': '/apps/pagekite/configure',
'text': _('Configure PageKite')}]}

View File

@ -40,9 +40,8 @@ class XMPP(PagePlugin):
@staticmethod
@cherrypy.expose
@require()
def index(**kwargs):
def index():
"""Serve XMPP page"""
del kwargs # Unused
main = "<p>XMPP Server Accounts and Configuration</p>"
sidebar_right = util.render_template(template='menu_block',
@ -107,13 +106,6 @@ class Configure(PagePlugin):
return {'inband_enabled': 'inband_enable' in output.split()}
@staticmethod
def sidebar_right(**kwargs):
"""Return rendered string for sidebar on the right"""
del kwargs # Unused
return util.render_template(template='menu_block', menu=SIDE_MENU)
@staticmethod
def _apply_changes(old_status, new_status, messages):
"""Apply the form changes"""
@ -133,7 +125,7 @@ class Configure(PagePlugin):
cfg.log.info('Option - %s' % option)
_output, error = actions.superuser_run('xmpp-setup', [option])
del _output
del _output # Unused
if error:
raise Exception('Error running command - %s' % error)