def unpack(self,reader): data = Data() path = struct.unpack(self.format_str, reader.read(struct.calcsize(self.format_str))) data.path = self._short_string(path[0]) data.type = packet_types.FS_STAT_FILE return data
def unpack(self, reader): path = struct.unpack(self.format_str, reader.read(struct.calcsize(self.format_str))) data = Data() data.path = self._short_string(path[0]) data.type = packet_types.FS_DELETE_FILE return data
def unpack(self, reader): (file_type, path, block_size, replicas) = struct.unpack(self.format_str, reader.read(struct.calcsize(self.format_str))) data = Data() data.file_type = file_type data.path = self._short_string(path) #self._short_string(path) data.block_size = block_size data.replicas = replicas data.type = packet_types.FS_CREATE return data
def unpack(self, reader): (file_type, path, block_size, replicas) = struct.unpack( self.format_str, reader.read(struct.calcsize(self.format_str))) data = Data() data.file_type = file_type data.path = self._short_string(path) #self._short_string(path) data.block_size = block_size data.replicas = replicas data.type = packet_types.FS_CREATE return data