mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-13 02:30:11 +01:00
Merge branch 'appdirs_platformdirs' into 'master'
Replace unmaintained appdirs by platformdirs See merge request fdroid/fdroidserver!1496
This commit is contained in:
commit
7f7c93e801
@ -133,17 +133,17 @@ orig_path = None
|
|||||||
|
|
||||||
|
|
||||||
def get_default_cachedir():
|
def get_default_cachedir():
|
||||||
"""Get a cachedir, using appdirs for cross-platform, but works without.
|
"""Get a cachedir, using platformdirs for cross-platform, but works without.
|
||||||
|
|
||||||
Once appdirs is installed everywhere, this function can be
|
Once platformdirs is installed everywhere, this function can be
|
||||||
removed.
|
removed.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
appname = __name__.split('.')[0]
|
appname = __name__.split('.')[0]
|
||||||
try:
|
try:
|
||||||
import appdirs
|
import platformdirs
|
||||||
|
|
||||||
return appdirs.user_cache_dir(appname, 'F-Droid')
|
return platformdirs.user_cache_dir(appname, 'F-Droid')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return str(Path.home() / '.cache' / appname)
|
return str(Path.home() / '.cache' / appname)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user