Did I find the right examples for you? yes no

All Samples(286)  |  Call(286)  |  Derive(0)  |  Import(0)
Utility method which wraps a function in a try:/except:, logs a failure if
one occurrs, and uses the system's logPrefix.

        def callWithLogger(logger, func, *args, **kw):
    """
    Utility method which wraps a function in a try:/except:, logs a failure if
    one occurrs, and uses the system's logPrefix.
    """
    try:
        lp = logger.logPrefix()
    except KeyboardInterrupt:
        raise
    except:
        lp = '(buggy logPrefix method)'
        err(system=lp)
    try:
        return callWithContext({"system": lp}, func, *args, **kw)
    except KeyboardInterrupt:
        raise
    except:
        err(system=lp)
        


src/z/o/zope.app.twisted-3.5.0/src/twisted/conch/ssh/connection.py   zope.app.twisted(Download)
                    channel.localWindowSize, 
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, '')
        except Exception, e:
            log.msg('channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[: 8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
        if dataLength > channel.localWindowLeft or \
           dataLength > channel.localMaxPacket: # more data than we want
            log.callWithLogger(channel, lambda s=self,c=channel: 
                                log.msg('too much data') and s.sendClose(c))
            return

src/h/o/hortonworks-sandbox-HEAD/desktop/core/ext-py/Twisted/twisted/conch/ssh/connection.py   hortonworks-sandbox(Download)
                    channel.localWindowSize,
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, packet)
        except Exception, e:
            log.msg('channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[:8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
 
    def ssh_CHANNEL_DATA(self, packet):
        if (dataLength > channel.localWindowLeft or
           dataLength > channel.localMaxPacket): # more data than we want
            log.callWithLogger(channel, log.msg, 'too much data')
            self.sendClose(channel)
            return

src/o/h/oh-mainline-HEAD/vendor/packages/twisted/twisted/conch/ssh/connection.py   oh-mainline(Download)
                    channel.localWindowSize,
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, packet)
        except Exception, e:
            log.msg('channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[:8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
 
    def ssh_CHANNEL_DATA(self, packet):
        if (dataLength > channel.localWindowLeft or
           dataLength > channel.localMaxPacket): # more data than we want
            log.callWithLogger(channel, log.msg, 'too much data')
            self.sendClose(channel)
            return

src/m/y/mythbox-HEAD/resources/lib/twisted/twisted/conch/ssh/connection.py   mythbox(Download)
                    channel.localWindowSize,
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, packet)
        except Exception, e:
            log.msg('channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[:8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
 
    def ssh_CHANNEL_DATA(self, packet):
        if (dataLength > channel.localWindowLeft or
           dataLength > channel.localMaxPacket): # more data than we want
            log.callWithLogger(channel, log.msg, 'too much data')
            self.sendClose(channel)
            return

src/s/u/SubliminalCollaborator-HEAD/libs/twisted/conch/ssh/connection.py   SubliminalCollaborator(Download)
                    channel.localWindowSize,
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, packet)
        except Exception, e:
            log.msg('channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[:8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
 
    def ssh_CHANNEL_DATA(self, packet):
        if (dataLength > channel.localWindowLeft or
           dataLength > channel.localMaxPacket): # more data than we want
            log.callWithLogger(channel, log.msg, 'too much data')
            self.sendClose(channel)
            return

src/t/w/Twisted-13.2.0/twisted/conch/ssh/connection.py   Twisted(Download)
                    channel.localWindowSize,
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, packet)
        except Exception, e:
            log.err(e, 'channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[:8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
 
    def ssh_CHANNEL_DATA(self, packet):
        if (dataLength > channel.localWindowLeft or
           dataLength > channel.localMaxPacket): # more data than we want
            log.callWithLogger(channel, log.msg, 'too much data')
            self.sendClose(channel)
            return

src/u/n/UnitScan-HEAD/twisted/conch/ssh/connection.py   UnitScan(Download)
                    channel.localWindowSize,
                    channel.localMaxPacket)+channel.specificData)
            log.callWithLogger(channel, channel.channelOpen, packet)
        except Exception, e:
            log.msg('channel open failed')
        channel.remoteWindowLeft = windowSize
        channel.remoteMaxPacket = maxPacket
        log.callWithLogger(channel, channel.channelOpen, specificData)
 
    def ssh_CHANNEL_OPEN_FAILURE(self, packet):
        channel.conn = self
        reason = error.ConchError(reasonDesc, reasonCode)
        log.callWithLogger(channel, channel.openFailed, reason)
 
    def ssh_CHANNEL_WINDOW_ADJUST(self, packet):
        localChannel, bytesToAdd = struct.unpack('>2L', packet[:8])
        channel = self.channels[localChannel]
        log.callWithLogger(channel, channel.addWindowBytes, bytesToAdd)
 
    def ssh_CHANNEL_DATA(self, packet):
        if (dataLength > channel.localWindowLeft or
           dataLength > channel.localMaxPacket): # more data than we want
            log.callWithLogger(channel, log.msg, 'too much data')
            self.sendClose(channel)
            return

src/h/o/hortonworks-sandbox-HEAD/desktop/core/ext-py/Twisted/twisted/internet/kqreactor.py   hortonworks-sandbox(Download)
                # handler disconnects another.
                continue
            log.callWithLogger(selectable, _drdw, selectable, fd, filter)
 
    def _doWriteOrRead(self, selectable, fd, filter):

src/o/h/oh-mainline-HEAD/vendor/packages/twisted/twisted/internet/kqreactor.py   oh-mainline(Download)
                # handler disconnects another.
                continue
            log.callWithLogger(selectable, _drdw, selectable, fd, filter)
 
    def _doWriteOrRead(self, selectable, fd, filter):

src/h/o/hortonworks-sandbox-HEAD/desktop/core/ext-py/Twisted/twisted/internet/win32eventreactor.py   hortonworks-sandbox(Download)
        canDoMoreWrites = 0
        for fd in self._writes.keys():
            if log.callWithLogger(fd, self._runWrite, fd):
                canDoMoreWrites = 1
 
        elif val >= WAIT_OBJECT_0 and val < WAIT_OBJECT_0 + len(handles):
            fd, action = self._events[handles[val - WAIT_OBJECT_0]]
            log.callWithLogger(fd, self._runAction, action, fd)
 
    def _runWrite(self, fd):

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next