Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/instance.py
blob: 259bc2d622d273a6d90f2bfca95677dc5b1b5f17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os

from sugar3 import profile
from sugar3 import util

class Instance:
    key = profile.get_pubkey()
    keyHash = util.sha_data(key)

    keyHashPrintable = util.printable_hash(keyHash)

    instancePath = None

    def __init__(self, ca):
        self.__class__.instancePath = os.path.join(ca.get_activity_root(), "instance")
        recreateTmp()


def recreateTmp():
    if (not os.path.exists(Instance.instancePath)):
        os.makedirs(Instance.instancePath)