2006-05-18 06:24:32 +02:00
|
|
|
import os
|
|
|
|
|
2006-05-12 08:46:59 +02:00
|
|
|
try:
|
2006-05-18 06:24:32 +02:00
|
|
|
from sugar.__uninstalled__ import *
|
2006-05-12 08:46:59 +02:00
|
|
|
except ImportError:
|
2006-05-18 06:24:32 +02:00
|
|
|
from sugar.__installed__ import *
|
2006-05-22 03:31:57 +02:00
|
|
|
|
|
|
|
def get_user_dir():
|
|
|
|
return os.path.expanduser('~/.sugar/')
|
2006-05-18 06:24:32 +02:00
|
|
|
|
2006-05-12 08:46:59 +02:00
|
|
|
def get_data_file(filename):
|
2006-05-18 06:24:32 +02:00
|
|
|
for data_dir in get_data_dirs():
|
|
|
|
path = os.path.join(data_dir, filename)
|
|
|
|
if os.path.isfile(path):
|
|
|
|
return path
|
|
|
|
return None
|
|
|
|
|
|
|
|
def get_data_dirs():
|
|
|
|
dirs = []
|
|
|
|
for data_dir in data_dirs:
|
|
|
|
path = os.path.join(data_basedir, data_dir)
|
|
|
|
dirs.append(path)
|
|
|
|
return dirs
|
|
|
|
|
|
|
|
def get_activities_dir():
|
|
|
|
return activities_dir
|