def _widgetDestroyed(self, *args):
     if self._timer:
         self.after_cancel(self._timer)
         self._timer = None
     if self._monitor is not None:
         job = netsvc.Job(self._monitor.destroyAgent)
         netsvc.Dispatcher().schedule(job, netsvc.STANDARD_JOB)
         self._monitor = None
Ejemplo n.º 2
0
    def _subscribeService(self):
        if self._monitor is not None:
            job = netsvc.Job(self._monitor.destroyAgent)
            netsvc.Dispatcher().schedule(job, netsvc.STANDARD_JOB)
            self._monitor = None

        self._service = self._serviceField.get()

        self._monitor = AgentMonitor(self._service)
        self._monitor.scheduleStartup()
        self._version = 0
Ejemplo n.º 3
0
 def __call__(self, *args):
     queue = Queue.Queue(0)
     service = _RequestService(queue, self._binding, self._methodName, args,
                               self._timeout)
     service.scheduleStartup()
     result = queue.get()
     #service.suspendEvents()
     #service.destroyAgent()
     #service.resumeEvents()
     job = netsvc.Job(service.destroyAgent, ())
     job.schedule(netsvc.PRIORITY_JOB)
     if type(result) == types.InstanceType and \
         result.__class__ is netsvc.ServiceFailure:
         raise result
     return result
    def _subscribeService(self):
        if self._monitor is not None:
            job = netsvc.Job(self._monitor.destroyAgent)
            netsvc.Dispatcher().schedule(job, netsvc.STANDARD_JOB)
            self._monitor = None

        if self._service != "":
            self._subjectView.clear()
            self._subjects = {}

            message = []
            message.append("TIMESTAMP = %s" % ` str(netsvc.DateTime()) `)
            message.append("EVENT     = 'UNSUBSCRIBE'")
            message.append("SERVICE   = %s" % ` self._service `)
            if self._identity != "":
                message.append("IDENTITY  = %s" % ` self._identity `)
            message.append("SUBJECT   = %s" % ` self._subject `)
            message.append("")
            message.append("")
            message = string.joinfields(message, "\n")
            self._appendLog(message)

            self._service = self._serviceField.get()
            self._identity = self._identityField.get()
            self._subject = self._subjectField.get()

            if self._service != "":
                message = []
                message.append("TIMESTAMP = %s" % ` str(netsvc.DateTime()) `)
                message.append("EVENT     = 'SUBSCRIBE'")
                message.append("SERVICE   = %s" % ` self._service `)
                if self._identity != "":
                    message.append("IDENTITY  = %s" % ` self._identity `)
                message.append("SUBJECT   = %s" % ` self._subject `)
                message.append("")
                message.append("")
                message = string.joinfields(message, "\n")
                self._appendLog(message)

                self._monitor = ReportService(self._service, self._identity,
                                              self._subject)
                self._monitor.scheduleStartup()
                self._version = 0
        else:
            self._service = self._serviceField.get()
            self._identity = self._identityField.get()
            self._subject = self._subjectField.get()
            if self._service != "":
                message = []
                message.append("TIMESTAMP = %s" % ` str(netsvc.DateTime()) `)
                message.append("EVENT     = 'SUBSCRIBE'")
                message.append("SERVICE   = %s" % ` self._service `)
                if self._identity != "":
                    message.append("IDENTITY  = %s" % ` self._identity `)
                message.append("SUBJECT   = %s" % ` self._subject `)
                message.append("")
                message.append("")
                message = string.joinfields(message, "\n")
                self._appendLog(message)

                self._monitor = ReportService(self._service, self._identity,
                                              self._subject)
                self._monitor.scheduleStartup()
                self._version = 0