1
# -*- coding: utf-8 -*-
3
# Authors: Natalia B Bidart <natalia.bidart@canonical.com>
5
# Copyright 2010 Canonical Ltd.
7
# This program is free software: you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License version 3, as published
9
# by the Free Software Foundation.
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranties of
13
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
# PURPOSE. See the GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License along
17
# with this program. If not, see <http://www.gnu.org/licenses/>.
19
"""Miscellaneous utilities."""
23
from ubuntuone.logger import logging
26
logger = logging.getLogger('ubuntuone.control_panel.utils')
30
"""Return the absolute path to this project's data/ dir.
32
Support symlinks, and priorize local (relative) data/ dir.
34
module = os.path.dirname(__file__)
35
result = os.path.abspath(os.path.join(module, os.path.pardir,
36
os.path.pardir, 'data'))
40
def get_data_file(filename):
41
"""Return the absolute path to 'filename' within data/ dir."""
42
return os.path.join(get_data_dir(), filename)