locations.py
Go to the documentation of this file.
1 # Copyright 2018 Mycroft AI Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 import os
15 from os.path import join, dirname, expanduser, exists
16 
17 DEFAULT_CONFIG = join(dirname(__file__), 'mycroft.conf')
18 SYSTEM_CONFIG = os.environ.get('MYCROFT_SYSTEM_CONFIG',
19  '/etc/mycroft/mycroft.conf')
20 USER_CONFIG = join(expanduser('~'), '.mycroft/mycroft.conf')
21 REMOTE_CONFIG = "mycroft.ai"
22 WEB_CONFIG_CACHE = os.environ.get('MYCROFT_WEB_CACHE',
23  '/var/tmp/mycroft_web_cache.json')
24 
25 
27  """ Make sure the directory for the specified path exists.
28 
29  Arguments:
30  path (str): path to config file
31  """
32  directory = dirname(path)
33  if not exists(directory):
34  os.makedirs(directory)
35 
36 
37 __ensure_folder_exists(WEB_CONFIG_CACHE)
38 __ensure_folder_exists(USER_CONFIG)


mycroft_ros
Author(s):
autogenerated on Mon Apr 26 2021 02:35:40