Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
libapparmor.22039
Split-out-UI_ShowFile-from-UI_Changes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Split-out-UI_ShowFile-from-UI_Changes.patch of Package libapparmor.22039
From bb3803b931683c841768ba6256c29e16bebd2eeb Mon Sep 17 00:00:00 2001 From: Christian Boltz <apparmor@cboltz.de> Date: Wed, 6 May 2020 23:16:47 +0200 Subject: [PATCH] Split off UI_ShowFile() from UI_Changes UI_ShowFile() is more generic and can be used to display various (text) files, not only diffs. --- utils/apparmor/ui.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/utils/apparmor/ui.py +++ b/utils/apparmor/ui.py @@ -254,13 +254,16 @@ else: difftemp = generate_diff_with_comments(oldprofile, newprofile) header = 'View Changes with comments' + UI_ShowFile(header, difftemp.name) + difftemp.close() + +def UI_ShowFile(header, filename): if UI_mode == 'json': - jsonout = {'dialog': 'changes', 'header':header, 'filename': difftemp.name} + jsonout = {'dialog': 'changes', 'header':header, 'filename': filename} write_json(jsonout) json_response('changes')["response"] # wait for response to delay deletion of difftemp (and ignore response content) else: - subprocess.call('less %s' % difftemp.name, shell=True) - difftemp.close() + subprocess.call(['less',filename]) CMDS = {'CMD_ALLOW': _('(A)llow'), 'CMD_OTHER': _('(M)ore'),
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor