示例#1
0
 def get_with_name(self, name=None):
     if not name:
         name = self._current
         if not name:
             raise AssertionError(self._miss_error)
         logger.debug("Choosing %s by default" % self._current)
     return self._cache[name], name
示例#2
0
 def get_with_name(self, name=None):
     if not name:
         name = self._current
         if not name:
             raise AssertionError(self._miss_error)
         logger.debug("Choosing %s by default" % self._current)
     return self._cache[name], name
 def _print_link(self, path, rc):
     if rc == 0:
         name = path + ".png"
         logger.info('<a href="%s"><img src="%s"></a>' % (name, name), True)
     else:
         logger.debug("Message sequence generation with seqdiag failed. Linking sequence file instead.")
         logger.info('<a href="%s">Message sequence</a>' % path, True)
示例#4
0
 def _print_link(self, path, rc):
     if rc == 0:
         name = path + '.png'
         logger.info('<a href="%s"><img src="%s"></a>' % (name, name), True)
     else:
         logger.debug(
             'Message sequence generation with seqdiag failed. Linking sequence file instead.'
         )
         logger.info('<a href="%s">Message sequence</a>' % path, True)
示例#5
0
文件: core.py 项目: mengzr/Rammbock
 def _receive(self, nodes, *parameters):
     configs, message_fields, header_fields = self._get_parameters_with_defaults(parameters)
     node, name = nodes.get_with_name(configs.pop('name', None))
     msg = node.get_message(self._get_message_template(), **configs)
     try:
         yield msg, message_fields, header_fields
         self._register_receive(node, self._current_container.name, name)
         logger.debug("Received %s" % repr(msg))
     except AssertionError, e:
         self._register_receive(node, self._current_container.name, name, error=e.args[0])
         raise e
示例#6
0
 def _receive(self, nodes, *parameters):
     configs, message_fields, header_fields = self._get_parameters_with_defaults(
         parameters)
     node, name = nodes.get_with_name(configs.pop('name', None))
     msg = node.get_message(self._get_message_template(), **configs)
     try:
         yield msg, message_fields, header_fields
         self._register_receive(node, self._current_container.name, name)
         logger.debug("Received %s" % repr(msg))
     except AssertionError, e:
         self._register_receive(node,
                                self._current_container.name,
                                name,
                                error=e.args[0])
         raise e
示例#7
0
 def log_receive(self, binary, ip, port):
     logger.debug("Trying to read %d bytes: %s from %s:%s over %s" %
                  (len(binary), to_hex(binary), ip, port,
                   self._transport_layer_name))
示例#8
0
 def log_send(self, binary, ip, port):
     logger.debug("Send %d bytes: %s to %s:%s over %s" %
                  (len(binary), to_hex(binary), ip, port,
                   self._transport_layer_name))
示例#9
0
 def _encode_message(self, message_fields, header_fields):
     msg = self._get_message_template().encode(message_fields,
                                               header_fields)
     logger.debug('%s' % repr(msg))
     return msg
示例#10
0
文件: core.py 项目: mengzr/Rammbock
 def _encode_message(self, message_fields, header_fields):
     msg = self._get_message_template().encode(message_fields, header_fields)
     logger.debug('%s' % repr(msg))
     return msg
示例#11
0
 def log_receive(self, binary, ip, port):
     logger.debug("Trying to read %d bytes: %s from %s:%s over %s" % (len(binary), to_hex(binary), ip, port, self._transport_layer_name))
示例#12
0
 def log_send(self, binary, ip, port):
     logger.debug("Send %d bytes: %s to %s:%s over %s" % (len(binary), to_hex(binary), ip, port, self._transport_layer_name))