# Path: OSMPythonTools/cachingStrategy/base.py
# class CachingStrategyBase:
#     def __init__(self):
#         pass
# 
#     def get(self, key):
#         raise(NotImplementedError('Subclass should implement get'))
# 
#     def set(self, key, data):
#         raise(NotImplementedError('Subclass should implement set'))
# 
#     def close(self):
#         pass


import os.path
import pickle
import gzip as libraryGzip
from OSMPythonTools.cachingStrategy.base import CachingStrategyBase


class Pickle(CachingStrategyBase):
    def __init__(self, cacheFile='cache', gzip=True):
        self._cacheFile = cacheFile + '.pickle' + ('.gzip' if gzip else '')
        self._open = libraryGzip.open if gzip else open
        self.close()

    def get(self, key):
        if self._cache is None:
            self.open()
        return self._cache[key] if key in self._cache else None

    def set(self, key, value):

# Path: OSMPythonTools/cachingStrategy/base.py
# class CachingStrategyBase:
#     def __init__(self):
#         pass
# 
#     def get(self, key):
#         raise(NotImplementedError('Subclass should implement get'))
# 
#     def set(self, key, data):
#         raise(NotImplementedError('Subclass should implement set'))
# 
#     def close(self):
#         pass


# Path: OSMPythonTools/cachingStrategy/pickle.py
import os.path
import pickle
import gzip as libraryGzip
from OSMPythonTools.cachingStrategy.base import CachingStrategyBase



class Pickle(CachingStrategyBase):
    def __init__(self, cacheFile='cache', gzip=True):
        self._cacheFile = cacheFile + '.pickle' + ('.gzip' if gzip else '')
        self._open = libraryGzip.open if gzip else open
        self.close()

    def get(self, key):
        if self._cache is None:
            self.open()
        return self._cache[key] if key in self._cache else None

    def set(self, key, value):

        if self._cache is None: