rpc-window: use pkg_resources for glade file

This is more canonical way for accessing data files.

QubesOS/qubes-issues#910
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-24 01:44:52 +01:00
parent 067940f5aa
commit b1dbc0647f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
3 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

@ -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',