diff --git a/qubespolicy/gtkhelpers.py b/qubespolicy/gtkhelpers.py index 2b1276ee..4ba52ac6 100644 --- a/qubespolicy/gtkhelpers.py +++ b/qubespolicy/gtkhelpers.py @@ -26,8 +26,6 @@ from gi.repository import Gtk, Gdk, GdkPixbuf, GObject, GLib import qubes from qubespolicy.utils import sanitize_domain_name -glade_directory = os.path.join(os.path.dirname(__file__), "glade") - class GtkIconGetter: def __init__(self, size): diff --git a/qubespolicy/rpcconfirmation.py b/qubespolicy/rpcconfirmation.py index a17e873b..06eed554 100644 --- a/qubespolicy/rpcconfirmation.py +++ b/qubespolicy/rpcconfirmation.py @@ -18,18 +18,17 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # - - +import pkg_resources from gi.repository import Gtk, Gdk, GLib import os -from qubespolicy.gtkhelpers import VMListModeler, FocusStealingHelper, \ - glade_directory +from qubespolicy.gtkhelpers import VMListModeler, FocusStealingHelper from qubespolicy.utils import sanitize_domain_name, \ sanitize_service_name class RPCConfirmationWindow: - _source_file = os.path.join(glade_directory, "RPCConfirmationWindow.glade") + _source_file = pkg_resources.resource_filename('qubespolicy', + os.path.join('glade', "RPCConfirmationWindow.glade")) _source_id = {'window': "RPCConfirmationWindow", 'ok': "okButton", 'cancel': "cancelButton", diff --git a/setup.py b/setup.py index e1ee6e73..e54e4aaf 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,9 @@ if __name__ == '__main__': license='GPL2+', url='https://www.qubes-os.org/', packages=setuptools.find_packages(exclude=('core*', 'tests')), + package_data = { + 'qubespolicy': ['glade/*.glade'], + }, entry_points={ 'console_scripts': list(get_console_scripts()) + [ 'qrexec-policy = qubespolicy.cli:main',