diff --git a/netcache.py b/netcache.py new file mode 100644 index 0000000..7991fbd --- /dev/null +++ b/netcache.py @@ -0,0 +1,17 @@ +#!/bin/python +import os + +cache_home = os.environ.get('XDG_CACHE_HOME') or\ + os.path.join(_home,'.cache') +_CACHE_PATH = os.path.join(cache_home,"offpunk/") + +if not os.path.exists(_CACHE_PATH): + print("Creating cache directory {}".format(_CACHE_PATH)) + os.makedirs(_CACHE_PATH) + + +def get_cache_path(url): + +def is_cache_valid(url,validity=0): + + diff --git a/offpunk.py b/offpunk.py index 5c5f738..66dca4d 100755 --- a/offpunk.py +++ b/offpunk.py @@ -99,9 +99,6 @@ data_home = os.environ.get('XDG_DATA_HOME') or \ os.path.join(_home,'.local','share') config_home = os.environ.get('XDG_CONFIG_HOME') or \ os.path.join(_home,'.config') -cache_home = os.environ.get('XDG_CACHE_HOME') or\ - os.path.join(_home,'.cache') -_CACHE_PATH = os.path.join(cache_home,"offpunk/") _CONFIG_DIR = os.path.join(config_home,"offpunk/") _DATA_DIR = os.path.join(data_home,"offpunk/") _old_config = os.path.expanduser("~/.offpunk/") @@ -468,7 +465,7 @@ class GeminiItem(): newgi = GeminiItem(url) toreturn.append(newgi) elif url and mode != "links_only" and url.startswith("data:image/"): - imgurl,imgdata = looks_like_base64(url,self.url) + imgurl,imgdata = ansirenderer.looks_like_base64(url,self.url) if imgurl: toreturn.append(GeminiItem(imgurl)) else: @@ -3218,7 +3215,7 @@ def main(): GeminiClient.do_version(None,None) sys.exit() else: - for f in [_CONFIG_DIR, _CACHE_PATH, _DATA_DIR]: + for f in [_CONFIG_DIR, _DATA_DIR]: if not os.path.exists(f): print("Creating config directory {}".format(f)) os.makedirs(f)