mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1279564 - Use get_state_dir() from mozboot; r=glandium
Import mozboot.util and use the function from there. MozReview-Commit-ID: B0uzpNff1t9 --HG-- extra : rebase_source : 161b944cfa8a0f74c395af17d121e0bdf4ffe0b2 extra : amend_source : 40dc50cade12cf1dcc7966c3ec514807ee746d82
This commit is contained in:
parent
d46f71b8c0
commit
48ef397191
@ -176,21 +176,6 @@ CATEGORIES = {
|
||||
TELEMETRY_SUBMISSION_FREQUENCY = 10
|
||||
|
||||
|
||||
def get_state_dir():
|
||||
"""Obtain the path to a directory to hold state.
|
||||
|
||||
Returns a tuple of the path and a bool indicating whether the value came
|
||||
from an environment variable.
|
||||
"""
|
||||
state_user_dir = os.path.expanduser('~/.mozbuild')
|
||||
state_env_dir = os.environ.get('MOZBUILD_STATE_PATH', None)
|
||||
|
||||
if state_env_dir:
|
||||
return state_env_dir, True
|
||||
else:
|
||||
return state_user_dir, False
|
||||
|
||||
|
||||
def bootstrap(topsrcdir, mozilla_dir=None):
|
||||
if mozilla_dir is None:
|
||||
mozilla_dir = topsrcdir
|
||||
@ -213,6 +198,7 @@ def bootstrap(topsrcdir, mozilla_dir=None):
|
||||
# like surprises.
|
||||
sys.path[0:0] = [os.path.join(mozilla_dir, path) for path in SEARCH_PATHS]
|
||||
import mach.main
|
||||
from mozboot.util import get_state_dir
|
||||
|
||||
def telemetry_handler(context, data):
|
||||
# We have not opted-in to telemetry
|
||||
|
Loading…
Reference in New Issue
Block a user