kopia lustrzana https://github.com/ctjacobs/pyqso
Only use pkg_resources.
rodzic
a200eae434
commit
7e28366aae
16
bin/pyqso
16
bin/pyqso
|
@ -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):
|
||||
|
|
Ładowanie…
Reference in New Issue