comparison pytouhou/menu.py @ 572:7f113f15300b

Include the Glade file in the main package on install.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 09 Jul 2014 23:44:53 +0200
parents f0252cf111d8
children d1f0bb0b7a17
comparison
equal deleted inserted replaced
571:e992927f07a8 572:7f113f15300b
13 ## 13 ##
14 14
15 from pytouhou.utils.helpers import get_logger 15 from pytouhou.utils.helpers import get_logger
16 logger = get_logger(__name__) 16 logger = get_logger(__name__)
17 17
18 from gi.repository import Gtk, Gdk 18 from gi.repository import Gtk, Gdk, GLib
19 19
20 import sys 20 import sys
21 import os
21 import re 22 import re
22 23
23 GL_VERSION_REGEX = re.compile(r'^\d\.\d$') 24 GL_VERSION_REGEX = re.compile(r'^\d\.\d$')
24 25
25 26
291 def menu(config, args): 292 def menu(config, args):
292 assert Gtk 293 assert Gtk
293 handler = Handler(config, args) 294 handler = Handler(config, args)
294 295
295 builder = Gtk.Builder() 296 builder = Gtk.Builder()
296 builder.add_from_file('data/menu.glade') 297 try:
298 builder.add_from_file(os.path.join(os.path.dirname(__file__), 'data', 'menu.glade'))
299 except GLib.GError:
300 builder.add_from_file(os.path.join('data', 'menu.glade'))
297 builder.connect_signals(handler) 301 builder.connect_signals(handler)
298 302
299 handler.init_gtk(builder) 303 handler.init_gtk(builder)
300 304
301 Gtk.main() 305 Gtk.main()