kopia lustrzana https://github.com/ctjacobs/pyqso
Use the pkg_resources module to find the Glade file for bin/pyqso. Also, don't use "/" to join bits of the path, just give each bit as a separate argument.
rodzic
9e184b9feb
commit
4a595d7cbe
|
@ -30,6 +30,7 @@ import os
|
|||
import os.path
|
||||
import sys
|
||||
import signal
|
||||
from pkg_resources import resource_filename
|
||||
|
||||
# This will help Python find the PyQSO modules that need to be imported below.
|
||||
pyqso_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir)
|
||||
|
@ -59,7 +60,7 @@ class PyQSO:
|
|||
"""
|
||||
|
||||
self.builder = Gtk.Builder()
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = resource_filename("pyqso", os.path.join(os.pardir, "res", "pyqso.glade"))
|
||||
self.builder.add_from_file(glade_file_path)
|
||||
self.window = self.builder.get_object("pyqso")
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class CabrilloExportDialog:
|
|||
logging.debug("Building new Cabrillo export dialog...")
|
||||
|
||||
self.builder = application.builder
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("cabrillo_export_dialog",))
|
||||
self.dialog = self.builder.get_object("cabrillo_export_dialog")
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class CalendarDialog:
|
|||
"""
|
||||
|
||||
self.builder = application.builder
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("calendar_dialog",))
|
||||
self.dialog = self.builder.get_object("calendar_dialog")
|
||||
self.calendar = self.builder.get_object("calendar")
|
||||
|
|
|
@ -36,7 +36,7 @@ class LogNameDialog:
|
|||
logging.debug("Building new log name dialog...")
|
||||
|
||||
self.builder = application.builder
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("log_name_dialog",))
|
||||
self.dialog = self.builder.get_object("log_name_dialog")
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class PreferencesDialog:
|
|||
|
||||
self.application = application
|
||||
self.builder = self.application.builder
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("preferences_dialog",))
|
||||
self.dialog = self.builder.get_object("preferences_dialog")
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class RecordDialog:
|
|||
|
||||
self.application = application
|
||||
self.builder = self.application.builder
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("record_dialog",))
|
||||
self.dialog = self.builder.get_object("record_dialog")
|
||||
self.builder.get_object("record_dialog").connect("key-press-event", self.on_key_press)
|
||||
|
|
|
@ -51,7 +51,7 @@ class Summary(object):
|
|||
self.application = application
|
||||
self.logbook = self.application.logbook
|
||||
self.builder = self.application.builder
|
||||
glade_file_path = join(realpath(dirname(__file__)), pardir, "res/pyqso.glade")
|
||||
glade_file_path = join(realpath(dirname(__file__)), pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("summary_page",))
|
||||
self.summary_page = self.builder.get_object("summary_page")
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class TelnetConnectionDialog:
|
|||
"""
|
||||
|
||||
self.builder = application.builder
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
|
||||
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res", "pyqso.glade")
|
||||
self.builder.add_objects_from_file(glade_file_path, ("telnet_connection_dialog",))
|
||||
self.dialog = self.builder.get_object("telnet_connection_dialog")
|
||||
self.sources = {"HOST": self.builder.get_object("host_entry"),
|
||||
|
|
Ładowanie…
Reference in New Issue