1
# -*- coding: utf-8 -*-
3
# This file is in the public domain
6
"""Helpers for an Ubuntu application."""
15
from gnome_gcs.gnome_gcsconfig import get_data_file
18
from gettext import gettext as _
19
gettext.textdomain('gnome-gcs')
21
def get_builder(builder_file_name):
22
"""Return a fully-instantiated gtk.Builder instance from specified ui
25
:param builder_file_name: The name of the builder file, without extension.
26
Assumed to be in the 'ui' directory under the data path.
28
# Look for the ui file that describes the user interface.
29
ui_filename = get_data_file('ui', '%s.ui' % (builder_file_name,))
30
if not os.path.exists(ui_filename):
33
builder = gtk.Builder()
34
builder.set_translation_domain('gnome-gcs')
35
builder.add_from_file(ui_filename)