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.

pull/61/head
Christian T. Jacobs 2017-07-05 21:50:40 +01:00
rodzic 9e184b9feb
commit 4a595d7cbe
8 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -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")

Wyświetl plik

@ -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")

Wyświetl plik

@ -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")

Wyświetl plik

@ -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")

Wyświetl plik

@ -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")

Wyświetl plik

@ -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)

Wyświetl plik

@ -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")

Wyświetl plik

@ -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"),