Example #1
0
    def rpc_status(self, sender, *args):
        """rpc_status() -> dict

        Return assorted status information. This returns a Jabber-RPC struct
        containing these fields:

            online: Whether the Parlor is online.
            startup_time: When the Parlor was started.
            startup_at: How long ago the Parlor was started.
            last_new_table: How long ago it's been since a table was started.
            tables_running: How many tables are currently open.
            tables_started: How many tables have been started since the
                Parlor began.
        """

        if (len(args) != 0):
            raise rpc.RPCFault(604, 'status: no arguments')
        dic = {}
        dic['online'] = self.parlor.online
        dic['startup_time'] = time.ctime(self.parlor.startuptime)
        dic['startup_at'] = volent.descinterval(self.parlor.startuptime,
                                                limit=2)
        dic['last_new_table'] = volent.descinterval(self.parlor.activitytime,
                                                    limit=2)
        dic['tables_running'] = len(self.parlor.referees)
        dic['tables_started'] = self.parlor.refereesstarted

        return dic
Example #2
0
    def rpc_status(self, sender, *args):
        """rpc_status() -> dict

        Return assorted status information. This returns a Jabber-RPC struct
        containing these fields:

            online: Whether the Parlor is online.
            startup_time: When the Parlor was started.
            startup_at: How long ago the Parlor was started.
            last_new_table: How long ago it's been since a table was started.
            tables_running: How many tables are currently open.
            tables_started: How many tables have been started since the
                Parlor began.
        """

        if (len(args) != 0):
            raise rpc.RPCFault(604, 'status: no arguments')
        dic = {}
        dic['online'] = self.parlor.online
        dic['startup_time'] = time.ctime(self.parlor.startuptime)
        dic['startup_at'] = volent.descinterval(
            self.parlor.startuptime,
            limit=2)
        dic['last_new_table'] = volent.descinterval(
            self.parlor.activitytime,
            limit=2)
        dic['tables_running'] = len(self.parlor.referees)
        dic['tables_started'] = self.parlor.refereesstarted
        
        return dic
Example #3
0
    def rpc_status(self, sender, *args):
        """rpc_status() -> dict

        Return assorted status information. This returns a Jabber-RPC struct
        containing these fields:

            online: Whether the Factory is online.
            startup_time: When the Factory was started.
            startup_at: How long ago the Factory was started.
            last_new_bot: How long ago it's been since a bot was started.
            bots_running: How many bots are currently open.
            bots_started: How many bots have been started since the
                Factory began.
        """
        
        if (len(args) != 0):
            raise rpc.RPCFault(604, 'status: no arguments')
        dic = {}
        dic['online'] = self.factory.online
        dic['startup_time'] = time.ctime(self.factory.startuptime)
        dic['startup_at'] = volent.descinterval(
            self.factory.startuptime,
            limit=2)
        dic['last_new_bot'] = volent.descinterval(
            self.factory.activitytime,
            limit=2)
        dic['bots_running'] = len(self.factory.actors)
        dic['bots_started'] = self.factory.actorsstarted
        
        return dic