Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cherrypy.expose
def index(self):
return """
@cherrypy.expose()
def shutdown(self):
""" Shutdown CherryPy and exit script """
self.logger.info("Shutting down htpc-manager.")
cherrypy.engine.exit()
return "HTPC Manager has shut down"
@cherrypy.expose
def set_exec_status(self, user, epname, new_status, msg=''):
"""
Set execution status for one EP. (0, 1, 2, or 3)\n
Returns a string (stopped, paused, running).\n
The `message` parameter can explain why the status has changed.\n
Called from the EP.
"""
logFull('CeXmlRpc:set_exec_status user `{}`.'.format(user))
return self.project.set_exec_status(user, epname, new_status, msg)
@cherrypy.expose
def activate(self, *args):
validate_method(('POST',))
ret = self.obj.activate()
return Response(self.ctx, ret).render()
@cherrypy.expose
def index(self):
from domoweb.rinor.pipes import EventPipe
#Set the expected headers...
cherrypy.response.headers["Content-Type"] = "text/event-stream; charset=utf-8"
return EventPipe().get_event()
index._cp_config = {'response.stream': True}
@cherrypy.expose
def save_reserved_tb(self, res_query, props={}):
"""
User has made some changes only on self.reserved_resources.
In this method we sync self.reserved_resources with self.resources
and the store on the disk
"""
logDebug('CeTestBeds:save_reserved_tb {}'.format(res_query))
user_info = self.user_info(props)
resources = self.resources
# If no resources...
if not resources.get('children'):
msg = 'User {}: Save reserved resource: There are no resources defined !'.format(user_info[0])
logError(msg)
@cherrypy.expose
def getDownloadDetailFrame(self, id):
download = Download.get(Download.id == id)
template = self.env.get_template('modalFrames/downloadDetailFrame.html')
return template.render(download=download, **self._globals())
@cherrypy.expose
def list(self, series=None, skip=None, ignore=None):
logger = logging.getLogger("mediarover.interface.tv.filter")
vars = build_default_template_vars(self._config)
all_filters = {}
for name in self._config['tv']['filter']:
clean = Series.sanitize_series_name(name, self._config['tv']['ignore_series_metadata'])
all_filters[clean] = {
'name': name,
'filters': self._config['tv']['filter'][name],
}
# build list of template filters
vars['dir_list'] = []
for root in self._config['tv']['tv_root']:
@cherrypy.expose()
@require()
@cherrypy.tools.json_out()
def start(self, torrent_id):
return self.do_action('start', hash=torrent_id).json()
@cherrypy.expose
def computeGOSimilarity(self, funcData):
return self.cdk.computeGOSimilarity(funcData)