summaryrefslogtreecommitdiff
path: root/lib/utils/cache.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-05-01 20:37:51 -0400
committerLex Neva <github.com@lexneva.name>2018-05-01 20:37:51 -0400
commit1b31806423c8fec4040fed6d1009db016860b763 (patch)
tree71ccac169471e76685a7fa0b9910f64555dc73a7 /lib/utils/cache.py
parent5b7f14d092456a941dbd189e61ed38d9b16d388b (diff)
rename inkstitch/ to lib/
You can't have a module and a package named the same thing. PyInstaller wants to import the main script as if it were a module, and this doesn't work unless there's no directory of the same name with a __init__.py in it.
Diffstat (limited to 'lib/utils/cache.py')
-rw-r--r--lib/utils/cache.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils/cache.py b/lib/utils/cache.py
new file mode 100644
index 00000000..38fe8f2c
--- /dev/null
+++ b/lib/utils/cache.py
@@ -0,0 +1,8 @@
+try:
+ from functools import lru_cache
+except ImportError:
+ from backports.functools_lru_cache import lru_cache
+
+# simplify use of lru_cache decorator
+def cache(*args, **kwargs):
+ return lru_cache(maxsize=None)(*args, **kwargs)