1# -*- coding: utf-8 -*- 2 3# This file is part of CoCalc: Copyright © 2020 Sagemath, Inc. 4# License: AGPLv3 s.t. "Commons Clause" – read LICENSE.md for details 5 6# All our code in this modules assumes that an environment variable SMC exists 7# and that the directory is points to also exists. We make it ~/.smc by default. 8 9from __future__ import absolute_import 10import os 11if not 'SMC' in os.environ: 12 os.environ['SMC'] = os.path.join(os.environ['HOME'], '.smc') 13 14if not os.path.exists(os.environ['SMC']): 15 try: 16 os.makedirs(os.environ['SMC']) 17 except: 18 pass 19 20