Mercurial > libervia-backend
comparison sat/core/constants.py @ 2684:a7529543bbb1
core: fixed package name for Android
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 05 Oct 2018 13:42:06 +0200 |
parents | 0fa217fafabf |
children | 1ecceac3df96 |
comparison
equal
deleted
inserted
replaced
2683:38af118a7d74 | 2684:a7529543bbb1 |
---|---|
172 | 172 |
173 ## Configuration ## | 173 ## Configuration ## |
174 if ( | 174 if ( |
175 BaseDirectory | 175 BaseDirectory |
176 ): # skipped when xdg module is not available (should not happen in backend) | 176 ): # skipped when xdg module is not available (should not happen in backend) |
177 if "org.salutatoi.cagou.cagou" in BaseDirectory.__file__: | 177 if "org.salutatoi.cagou" in BaseDirectory.__file__: |
178 # FIXME: hack to make config read from the right location on Android | 178 # FIXME: hack to make config read from the right location on Android |
179 # TODO: fix it in a more proper way | 179 # TODO: fix it in a more proper way |
180 | 180 |
181 # we need to use Android API to get downloads directory | 181 # we need to use Android API to get downloads directory |
182 import os.path | 182 import os.path |
184 | 184 |
185 Environment = autoclass("android.os.Environment") | 185 Environment = autoclass("android.os.Environment") |
186 | 186 |
187 BaseDirectory = None | 187 BaseDirectory = None |
188 DEFAULT_CONFIG = { | 188 DEFAULT_CONFIG = { |
189 "local_dir": "/data/data/org.salutatoi.cagou.cagou/app", | 189 "local_dir": "/data/data/org.salutatoi.cagou/app", |
190 "media_dir": "/data/data/org.salutatoi.cagou.cagou/files/app/media", | 190 "media_dir": "/data/data/org.salutatoi.cagou/files/app/media", |
191 # FIXME: temporary location for downloads, need to call API properly | 191 # FIXME: temporary location for downloads, need to call API properly |
192 "downloads_dir": os.path.join( | 192 "downloads_dir": os.path.join( |
193 Environment.getExternalStoragePublicDirectory( | 193 Environment.getExternalStoragePublicDirectory( |
194 Environment.DIRECTORY_DOWNLOADS | 194 Environment.DIRECTORY_DOWNLOADS |
195 ).getAbsolutePath(), | 195 ).getAbsolutePath(), |
197 ), | 197 ), |
198 "pid_dir": "%(local_dir)s", | 198 "pid_dir": "%(local_dir)s", |
199 "log_dir": "%(local_dir)s", | 199 "log_dir": "%(local_dir)s", |
200 } | 200 } |
201 CONFIG_FILES = [ | 201 CONFIG_FILES = [ |
202 "/data/data/org.salutatoi.cagou.cagou/files/app/android/" | 202 "/data/data/org.salutatoi.cagou/files/app/android/" |
203 + APP_NAME_FILE | 203 + APP_NAME_FILE |
204 + ".conf" | 204 + ".conf" |
205 ] | 205 ] |
206 else: | 206 else: |
207 | 207 |