mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
use appdirs to get easy cross-platform standard directories
This is more important to get right now, with `fdroid install`, which should work easily on all platforms.
This commit is contained in:
parent
f003492574
commit
6781525ddd
@ -134,11 +134,27 @@ env = None
|
|||||||
orig_path = None
|
orig_path = None
|
||||||
|
|
||||||
|
|
||||||
|
def get_default_cachedir():
|
||||||
|
"""Get a cachedir, using appdirs for cross-platform, but works without.
|
||||||
|
|
||||||
|
Once appdirs is installed everywhere, this function can be
|
||||||
|
removed.
|
||||||
|
|
||||||
|
"""
|
||||||
|
appname = __name__.split('.')[0]
|
||||||
|
try:
|
||||||
|
import appdirs
|
||||||
|
|
||||||
|
return appdirs.user_cache_dir(appname, 'F-Droid')
|
||||||
|
except ImportError:
|
||||||
|
return str(Path.home() / '.cache' / appname)
|
||||||
|
|
||||||
|
|
||||||
# All paths in the config must be strings, never pathlib.Path instances
|
# All paths in the config must be strings, never pathlib.Path instances
|
||||||
default_config = {
|
default_config = {
|
||||||
'sdk_path': "$ANDROID_HOME",
|
'sdk_path': "$ANDROID_HOME",
|
||||||
'ndk_paths': {},
|
'ndk_paths': {},
|
||||||
'cachedir': str(Path.home() / '.cache/fdroidserver'),
|
'cachedir': get_default_cachedir(),
|
||||||
'java_paths': None,
|
'java_paths': None,
|
||||||
'scan_binary': False,
|
'scan_binary': False,
|
||||||
'ant': "ant",
|
'ant': "ant",
|
||||||
|
Loading…
Reference in New Issue
Block a user