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:
parent
067940f5aa
commit
b1dbc0647f
@ -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):
|
||||
|
@ -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",
|
||||
|
3
setup.py
3
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',
|
||||
|
Loading…
Reference in New Issue
Block a user