# Path: rhizi/util.py
# def debug_log_duration(method):
#     def timed(*args, **kw):
#     def str_to_unicode(s):
#     def str_to_unicode(s):


import base64
import gzip
import json
from ..util import str_to_unicode, python2





class RZCommit():
    """
    Rhizi Commit object

    Currently this object is substituted by either a diff object, this currently
    acts as a model stub.
    """

    @staticmethod
    def diff_obj_from_blob(blob):
        """
        @return json.loads(gzip_decompress(base64_decode(blob)))
        """
        blob_gzip = base64.decodestring(blob.encode('utf-8'))
        blob = gzip.zlib.decompress(blob_gzip).decode()
        return json.loads(blob)

    @staticmethod
    def blob_from_diff_obj(obj):
        """
        @return: blob = base64(gzip(json.dumps(obj)))
        """
        obj_bytes = json.dumps(obj).encode('utf-8')
        blob_gzip = gzip.zlib.compress(obj_bytes)
        blob_base64 = base64.encodestring(blob_gzip)

# Path: rhizi/util.py
# def debug_log_duration(method):
#     def timed(*args, **kw):
#     def str_to_unicode(s):
#     def str_to_unicode(s):


# Path: rhizi/model/model.py
import base64
import gzip
import json
from ..util import str_to_unicode, python2






class RZCommit():
    """
    Rhizi Commit object

    Currently this object is substituted by either a diff object, this currently
    acts as a model stub.
    """

    @staticmethod
    def diff_obj_from_blob(blob):
        """
        @return json.loads(gzip_decompress(base64_decode(blob)))
        """
        blob_gzip = base64.decodestring(blob.encode('utf-8'))
        blob = gzip.zlib.decompress(blob_gzip).decode()
        return json.loads(blob)

    @staticmethod
    def blob_from_diff_obj(obj):
        """
        @return: blob = base64(gzip(json.dumps(obj)))
        """
        obj_bytes = json.dumps(obj).encode('utf-8')
        blob_gzip = gzip.zlib.compress(obj_bytes)
        blob_base64 = base64.encodestring(blob_gzip)

        if not python2: