Beispiel #1
0
    def __start(self):
        if not os.path.exists(self.__db_path):
            logging.info("[%s] Initializing local cache DB..." % (self.map_id,))
            mkdirSafely(os.path.dirname(self.__db_path))
            self.__conn = sqlite3.connect(self.__db_path)
            self.__initDB()
        else:
            self.__conn = sqlite3.connect(self.__db_path)
            self.__readConfig()

        logging.info("[%s][Config] db schema: %s" % (self.map_id, self.__db_schema))
        logging.info("[%s][Config] suuport tile timestamp: %s" % (self.map_id, self.__has_timestamp))
Beispiel #2
0
    def __start(self):
        if not os.path.exists(self.__db_path):
            logging.info("[%s] Initializing local cache DB..." %
                         (self.map_id, ))
            mkdirSafely(os.path.dirname(self.__db_path))
            self.__conn = sqlite3.connect(self.__db_path)
            self.__initDB()
        else:
            self.__conn = sqlite3.connect(self.__db_path)
            self.__readConfig()

        logging.info("[%s][Config] db schema: %s" %
                     (self.map_id, self.__db_schema))
        logging.info("[%s][Config] suuport tile timestamp: %s" %
                     (self.map_id, self.__has_timestamp))
Beispiel #3
0
 def put(self, level, x, y, data):
     path = self.__genTilePath(level, x, y)
     mkdirSafely(os.path.dirname(path))
     with open(path, 'wb') as file:
         file.write(data)
Beispiel #4
0
 def start(self):
     mkdirSafely(self.__cache_dir)
Beispiel #5
0
 def put(self, level, x, y, data):
     path = self.__genTilePath(level, x, y)
     mkdirSafely(os.path.dirname(path))
     with open(path, 'wb') as file:
         file.write(data)
Beispiel #6
0
 def start(self):
     mkdirSafely(self.__cache_dir)