1
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
3
# Copyright (C) 2012 David Planella <david.planella@ubuntu.com>
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License version 3, as published
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License version 3, as published
6
6
# by the Free Software Foundation.
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranties of
10
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranties of
10
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
11
# PURPOSE. See the GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License along
13
# You should have received a copy of the GNU General Public License along
14
14
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
"""Helpers for an Ubuntu application."""
21
22
from . qreatorconfig import get_data_file
22
23
from . Builder import Builder
25
26
def get_builder(builder_file_name):
26
"""Return a fully-instantiated Gtk.Builder instance from specified ui
27
"""Return a fully-instantiated Gtk.Builder instance from specified ui
29
30
:param builder_file_name: The name of the builder file, without extension.
49
50
return media_filename
53
def get_cache_file(file_name):
54
path = os.path.join(xdg.BaseDirectory.xdg_cache_home, 'qreator', file_name)
55
if not os.path.exists(path):
52
60
class NullHandler(logging.Handler):
53
61
def emit(self, record):