# Path: neubot/six.py
# PY3 = sys.version_info[0] == 3
#     MAXSIZE = sys.maxsize
#         MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 63) - 1)
#         class X(object):
# class _LazyDescr(object):
# class MovedModule(_LazyDescr):
# class MovedAttribute(_LazyDescr):
# class _MovedItems(types.ModuleType):
#     class Iterator(object):
#             def __len__(self):
# def _add_doc(func, doc):
# def _import_module(name):
#     def __init__(self, name):
#     def __get__(self, obj, tp):
#     def __init__(self, name, old, new=None):
#     def _resolve(self):
#     def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
#     def _resolve(self):
# def add_move(move):
# def remove_move(name):
#     def advance_iterator(it):
#     def get_unbound_function(unbound):
#     def callable(obj):
#     def get_unbound_function(unbound):
#         def next(self):
# def iterkeys(d):
# def itervalues(d):
# def iteritems(d):
#     def b(s):
#     def u(s):
#         def int2byte(i):
#     def b(s):
#     def u(s):
#     def reraise(tp, value, tb=None):
#     def exec_(code, globs=None, locs=None):
#     def print_(*args, **kwargs):
#         def write(data):
# def with_metaclass(meta, base=object):
#     def buff(string, offset, size=None):
#     def bytes_to_string(octets, encoding):
#     def bytes_to_string_safe(octets, encoding):
#     def buff(string, offset, size=None):
#     def bytes_to_string(octets, encoding):
#     def bytes_to_string_safe(octets, encoding):


import logging
from neubot.compat import json
from neubot import six
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Neubot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Neubot.  If not, see <http://www.gnu.org/licenses/>.
#

''' HTTP utils '''

# Adapted from neubot/http/message.py


class Body(object):
    ''' Body that contains bytes '''
    def __init__(self):
        self.queue = []

    def write(self, octets):
        ''' Write octets into body '''
        self.queue.append(octets)

    def getvalue(self):
        ''' Return bufferized data '''

# Path: neubot/six.py
# PY3 = sys.version_info[0] == 3
#     MAXSIZE = sys.maxsize
#         MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 31) - 1)
#             MAXSIZE = int((1 << 63) - 1)
#         class X(object):
# class _LazyDescr(object):
# class MovedModule(_LazyDescr):
# class MovedAttribute(_LazyDescr):
# class _MovedItems(types.ModuleType):
#     class Iterator(object):
#             def __len__(self):
# def _add_doc(func, doc):
# def _import_module(name):
#     def __init__(self, name):
#     def __get__(self, obj, tp):
#     def __init__(self, name, old, new=None):
#     def _resolve(self):
#     def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
#     def _resolve(self):
# def add_move(move):
# def remove_move(name):
#     def advance_iterator(it):
#     def get_unbound_function(unbound):
#     def callable(obj):
#     def get_unbound_function(unbound):
#         def next(self):
# def iterkeys(d):
# def itervalues(d):
# def iteritems(d):
#     def b(s):
#     def u(s):
#         def int2byte(i):
#     def b(s):
#     def u(s):
#     def reraise(tp, value, tb=None):
#     def exec_(code, globs=None, locs=None):
#     def print_(*args, **kwargs):
#         def write(data):
# def with_metaclass(meta, base=object):
#     def buff(string, offset, size=None):
#     def bytes_to_string(octets, encoding):
#     def bytes_to_string_safe(octets, encoding):
#     def buff(string, offset, size=None):
#     def bytes_to_string(octets, encoding):
#     def bytes_to_string_safe(octets, encoding):


# Path: neubot/http_utils.py
import logging
from neubot.compat import json
from neubot import six

# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Neubot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Neubot.  If not, see <http://www.gnu.org/licenses/>.
#

''' HTTP utils '''

# Adapted from neubot/http/message.py


class Body(object):
    ''' Body that contains bytes '''
    def __init__(self):
        self.queue = []

    def write(self, octets):
        ''' Write octets into body '''
        self.queue.append(octets)

    def getvalue(self):
        ''' Return bufferized data '''

        data = six.b('').join(self.queue)