# Path: will/utils.py
# def sizeof_fmt(num, suffix='B'):
#     # http://stackoverflow.com/a/1094933
#     for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
#         if abs(num) < 1024.0:
#             return "%3.1f%s%s" % (num, unit, suffix)
#         num /= 1024.0
#     return "%.1f%s%s" % (num, 'Yi', suffix)
# 
# Path: will/backends/storage/base.py
# class BaseStorageBackend(PrivateBaseStorageBackend):
#     """
#     The base storage backend.  All storage backends must supply the following methods:
#     __init__() - sets up the connection
#     do_save() - saves a single value to a key
#     do_load() - gets a value from the backend
#     clear() - deletes a key
#     clear_all_keys() - clears the db
#     """
# 
#     def do_save(self, key, value, expire=None):
#         raise NotImplementedError
# 
#     def do_load(self, key):
#         raise NotImplementedError
# 
#     def clear(self, key):
#         raise NotImplementedError
# 
#     def clear_all_keys(self):
#         raise NotImplementedError


import logging
import os
import time
from will.utils import sizeof_fmt
from .base import BaseStorageBackend



class FileStorageException():
    """
    A condition that should not occur happened in the FileStorage module
    """
    pass



# Path: will/utils.py
# def sizeof_fmt(num, suffix='B'):
#     # http://stackoverflow.com/a/1094933
#     for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
#         if abs(num) < 1024.0:
#             return "%3.1f%s%s" % (num, unit, suffix)
#         num /= 1024.0
#     return "%.1f%s%s" % (num, 'Yi', suffix)
# 
# Path: will/backends/storage/base.py
# class BaseStorageBackend(PrivateBaseStorageBackend):
#     """
#     The base storage backend.  All storage backends must supply the following methods:
#     __init__() - sets up the connection
#     do_save() - saves a single value to a key
#     do_load() - gets a value from the backend
#     clear() - deletes a key
#     clear_all_keys() - clears the db
#     """
# 
#     def do_save(self, key, value, expire=None):
#         raise NotImplementedError
# 
#     def do_load(self, key):
#         raise NotImplementedError
# 
#     def clear(self, key):
#         raise NotImplementedError
# 
#     def clear_all_keys(self):
#         raise NotImplementedError


# Path: will/backends/storage/file_backend.py
import logging
import os
import time
from will.utils import sizeof_fmt
from .base import BaseStorageBackend




class FileStorageException():
    """
    A condition that should not occur happened in the FileStorage module
    """
    pass



class FileStorage(BaseStorageBackend):