Only use pkg_resources.

pull/61/head
Christian T. Jacobs 2017-07-06 00:41:20 +01:00
rodzic a200eae434
commit 7e28366aae
1 zmienionych plików z 2 dodań i 14 usunięć

Wyświetl plik

@ -61,11 +61,7 @@ class PyQSO:
# Get the PyQSO main window defined in the Glade file.
self.builder = Gtk.Builder()
try:
glade_file_path = pkg_resources.resource_filename("pyqso", os.path.join("res", "pyqso.glade"))
except ImportError:
# Assume the resources directory is in the parent directory of the directory containing this file.
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "pyqso", "res", "pyqso.glade")
glade_file_path = pkg_resources.resource_filename("pyqso", os.path.join("res", "pyqso.glade"))
self.builder.add_from_file(glade_file_path)
self.window = self.builder.get_object("pyqso")
@ -130,19 +126,11 @@ class PyQSO:
def show_about(self, widget):
""" Show the About dialog, which includes license information. """
# Get the About dialog defined in the Glade file.
try:
glade_file_path = pkg_resources.resource_filename("pyqso", os.path.join("res", "pyqso.glade"))
except ImportError:
# Assume the resources directory is in the parent directory of the directory containing this file.
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "pyqso", "res", "pyqso.glade")
glade_file_path = pkg_resources.resource_filename("pyqso", os.path.join("res", "pyqso.glade"))
self.builder.add_objects_from_file(glade_file_path, ("about_dialog",))
about = self.builder.get_object("about_dialog")
about.run()
about.destroy()
return
def show_preferences(self, widget):