How to use the cherrypy.expose function in CherryPy

To help you get started, we’ve selected a few CherryPy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github styxit / HTPC-Manager / htpc / root.py View on Github external
    @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"
github Luxoft / Twister / server / CeXmlRpc.py View on Github external
    @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)
github oVirt / vdsm / vdsm / rest / Controller.py View on Github external
    @cherrypy.expose
    def activate(self, *args):
        validate_method(('POST',))
        ret = self.obj.activate()
        return Response(self.ctx, ret).render()
github domogik / domoweb / src / domoweb / rinor / events.py View on Github external
    @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}
github Luxoft / Twister / server / CeTestBeds.py View on Github external
    @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)
github lad1337 / XDM / xdm / web / ajax.py View on Github external
    @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())
github kierse / mediarover / mediarover / interface / tv / filter.py View on Github external
	@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']:
github styxit / HTPC-Manager / modules / utorrent.py View on Github external
	@cherrypy.expose()
	@require()
	@cherrypy.tools.json_out()
	def start(self, torrent_id):
		return self.do_action('start', hash=torrent_id).json()
github Quetzal-RDF / quetzal / com.ibm.research.quetzal.core / pythonR / HttpServices.py View on Github external
    @cherrypy.expose
    def computeGOSimilarity(self, funcData):
        return self.cdk.computeGOSimilarity(funcData)