Files
dragonpilot/selfdrive/loggerd/config.py

20 lines
415 B
Python
Raw Normal View History

2016-11-29 18:34:21 -08:00
import os
2017-09-30 03:07:27 -07:00
if os.environ.get('LOGGERD_ROOT', False):
ROOT = os.environ['LOGGERD_ROOT']
print("Custom loggerd root: ", ROOT)
else:
ROOT = '/data/media/0/realdata/'
2016-11-29 18:34:21 -08:00
SEGMENT_LENGTH = 60
2019-06-06 04:38:45 +00:00
def get_available_percent():
try:
statvfs = os.statvfs(ROOT)
available_percent = 100.0 * statvfs.f_bavail / statvfs.f_blocks
except OSError:
available_percent = 100.0
return available_percent