Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

src/d/i/Diablo-III-Protocol-Simulator-HEAD/D3Packet.py   Diablo-III-Protocol-Simulator(Download)
#! /usr/bin/env python
 
 
import Utils
from ByteStream import ByteStream
  def __init__(self, bytes, recursive=True):
    if len(bytes) <= 4:
      raise RuntimeError('invalid packet length %d' % len(bytes))
    self.bytes = bytes
    self.stream = ByteStream(bytes)
  def Guess(self):
    if not self.HasPayload():
      return {}
    bs = ByteStream(self.payload)
    return Utils.ParseProtoBuffer(bs)

src/d/i/Diablo-III-Protocol-Simulator-HEAD/Utils.py   Diablo-III-Protocol-Simulator(Download)
#! /usr/bin/env python
 
 
import sys, os
from ByteStream import ByteStream
def FileByteStream(filepath):
  return ByteStream(FileBytes(filepath))
 
def StringToBytes(string):
  return map(lambda x: ord(x), string)