Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/smc_pyutil/smc_pyutil/__init__.py
Views: 285
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
9
from __future__ import absolute_import
10
import os
11
if not 'SMC' in os.environ:
12
os.environ['SMC'] = os.path.join(os.environ['HOME'], '.smc')
13
14
if not os.path.exists(os.environ['SMC']):
15
try:
16
os.makedirs(os.environ['SMC'])
17
except:
18
pass
19
20