-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add quotes to shell cmd to encapsulate arg1 * Do not process paths containing whitespace. * Fix pylint complaint with whitespace. * Fix flake8 errors * Add rejected file(s) list to dlg * fix flake8 linting error * Layout dialog text * Add rejected files to the dialog * Fix lint errors * Intermediate dev ci: dialog w/embedded list working * Intermediate dev ci: dialog displays files * Synced w/master * Display changeset list when asking the user to confirm deployment * Fix flake8/linting error * Intermediate dev CI. * Add internationalization to new confirmation dlg. * Fix flake8 linting errors * Update lexical-core version * Remove explicit lexical-core version * Fix failing CI UI tests * Again fix failing CI UI tests * Rename confirm info dlg file, delete unused dlg file * change module name to support renamed confirm info dlg module * Fix failing CI tests * Rename test file * Rename method to consistent with functionality * Add unit test to confirm_info_dialog
- Loading branch information
1 parent
df3a71f
commit 64cacca
Showing
8 changed files
with
147 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ | |
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: fapolicy-analyzer 0.0.4\n" | ||
"Project-Id-Version: fapolicy-analyzer snapshot\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2021-05-26 11:27-0400\n" | ||
"POT-Creation-Date: 2021-06-17 14:42-0400\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -48,138 +48,150 @@ msgid "" | |
" This will update the fapolicy trust and restart the service." | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:8 | ||
msgid "Action" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:9 | ||
msgid "File Path" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:11 | ||
msgid "This file is trusted." | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:10 | ||
#: fapolicy_analyzer/ui/strings.py:12 | ||
msgid "There is a discrepancy with this file." | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:11 | ||
#: fapolicy_analyzer/ui/strings.py:13 | ||
msgid "The trust status of this file is unknown." | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:13 | ||
#: fapolicy_analyzer/ui/strings.py:15 | ||
msgid "System Trust Database" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:14 | ||
#: fapolicy_analyzer/ui/strings.py:16 | ||
msgid "Ancillary Trust Database" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:16 | ||
#: glade/ancillary_trust_database_admin.glade:50 | ||
#: fapolicy_analyzer/glade/ancillary_trust_database_admin.glade:50 | ||
#: fapolicy_analyzer/ui/strings.py:18 | ||
msgid "Trust" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:17 | ||
#: fapolicy_analyzer/ui/strings.py:19 | ||
msgid "File" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:19 | ||
#: fapolicy_analyzer/ui/strings.py:21 | ||
msgid "Add File" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:21 | ||
#: fapolicy_analyzer/ui/strings.py:23 | ||
msgid "File path(s) contains embedded whitespace." | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/ui/strings.py:22 | ||
#: fapolicy_analyzer/ui/strings.py:24 | ||
msgid "" | ||
"fapolicyd currently does not support paths containing spaces. The " | ||
"following paths will not be added to the Trusted Files List.\n" | ||
"(fapolicyd: V TBD)\n" | ||
"\n" | ||
msgstr "" | ||
|
||
#: glade/analyzer_selection_dialog.glade:25 | ||
#: fapolicy_analyzer/glade/analyzer_selection_dialog.glade:25 | ||
msgid "Scan System" | ||
msgstr "" | ||
|
||
#: glade/analyzer_selection_dialog.glade:39 | ||
#: fapolicy_analyzer/glade/analyzer_selection_dialog.glade:39 | ||
msgid "Administer Trust Databases" | ||
msgstr "" | ||
|
||
#: glade/analyzer_selection_dialog.glade:61 | ||
#: fapolicy_analyzer/glade/analyzer_selection_dialog.glade:61 | ||
msgid "Analyzer Selection" | ||
msgstr "" | ||
|
||
#: glade/analyzer_selection_dialog.glade:94 | ||
#: fapolicy_analyzer/glade/analyzer_selection_dialog.glade:94 | ||
msgid "Analyze From Audit" | ||
msgstr "" | ||
|
||
#: glade/ancillary_trust_database_admin.glade:65 | ||
#: fapolicy_analyzer/glade/ancillary_trust_database_admin.glade:65 | ||
msgid "Untrust" | ||
msgstr "" | ||
|
||
#: glade/ancillary_trust_database_admin.glade:102 | ||
#: fapolicy_analyzer/glade/ancillary_trust_database_admin.glade:102 | ||
msgid "Deploy Ancillary Trust" | ||
msgstr "" | ||
|
||
#: glade/deploy_confirm_dialog.glade:10 | ||
#: fapolicy_analyzer/glade/deploy_confirm_dialog.glade:10 | ||
msgid "Keep these trust changes?" | ||
msgstr "" | ||
|
||
#: glade/deploy_confirm_dialog.glade:11 | ||
#: fapolicy_analyzer/glade/deploy_confirm_dialog.glade:11 | ||
msgid "Reverting to previous settings in 15 seconds." | ||
msgstr "" | ||
|
||
#: glade/main_window.glade:7 | ||
#: fapolicy_analyzer/glade/main_window.glade:7 | ||
msgid "About File Acccess Policy Analyzer" | ||
msgstr "" | ||
|
||
#: glade/main_window.glade:54 | ||
#: fapolicy_analyzer/glade/main_window.glade:54 | ||
msgid "File Access Policy Analyzer" | ||
msgstr "" | ||
|
||
#: glade/main_window.glade:73 | ||
#: fapolicy_analyzer/glade/main_window.glade:77 | ||
msgid "_File" | ||
msgstr "" | ||
|
||
#: glade/main_window.glade:97 | ||
#: fapolicy_analyzer/glade/main_window.glade:101 | ||
msgid "_Help" | ||
msgstr "" | ||
|
||
#: glade/system_trust_database_admin.glade:44 | ||
#: fapolicy_analyzer/glade/notification.glade:29 | ||
msgid "x" | ||
msgstr "" | ||
|
||
#: fapolicy_analyzer/glade/system_trust_database_admin.glade:44 | ||
msgid "Add File To Ancillary Trust Database" | ||
msgstr "" | ||
|
||
#: glade/trust_file_details.glade:41 | ||
#: fapolicy_analyzer/glade/trust_file_details.glade:41 | ||
msgid "In Database" | ||
msgstr "" | ||
|
||
#: glade/trust_file_details.glade:81 | ||
#: fapolicy_analyzer/glade/trust_file_details.glade:81 | ||
msgid "On File System" | ||
msgstr "" | ||
|
||
#: glade/trust_file_details.glade:120 | ||
#: fapolicy_analyzer/glade/trust_file_details.glade:120 | ||
msgid "File Trust Status" | ||
msgstr "" | ||
|
||
#: glade/trust_file_list.glade:75 | ||
#: fapolicy_analyzer/glade/trust_file_list.glade:75 | ||
msgid "page0" | ||
msgstr "" | ||
|
||
#: glade/trust_file_list.glade:102 | ||
#: fapolicy_analyzer/glade/trust_file_list.glade:102 | ||
msgid "Loading..." | ||
msgstr "" | ||
|
||
#: glade/trust_file_list.glade:117 | ||
#: fapolicy_analyzer/glade/trust_file_list.glade:117 | ||
msgid "page1" | ||
msgstr "" | ||
|
||
#: glade/unapplied_changes_dialog.glade:8 | ||
#: fapolicy_analyzer/glade/unapplied_changes_dialog.glade:8 | ||
msgid "Unapplied Changes" | ||
msgstr "" | ||
|
||
#: glade/unapplied_changes_dialog.glade:15 | ||
#: fapolicy_analyzer/glade/unapplied_changes_dialog.glade:15 | ||
msgid "" | ||
"\n" | ||
"There are unapplied changes." | ||
msgstr "" | ||
|
||
#: glade/unapplied_changes_dialog.glade:16 | ||
#: fapolicy_analyzer/glade/unapplied_changes_dialog.glade:16 | ||
msgid "Your changes will be lost." | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
python/fapolicy_analyzer/tests/test_confirm_info_dialog.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import context # noqa: F401 | ||
import gi | ||
|
||
gi.require_version("Gtk", "3.0") | ||
from gi.repository import Gtk | ||
from helpers import delayed_gui_action | ||
from ui.confirm_info_dialog import ConfirmInfoDialog | ||
|
||
|
||
def test_creates_widget(): | ||
widget = ConfirmInfoDialog() | ||
assert type(widget) is ConfirmInfoDialog | ||
|
||
|
||
def test_adds_dialog_to_parent(): | ||
parent = Gtk.Window() | ||
widget = ConfirmInfoDialog(parent=parent) | ||
assert widget.get_transient_for() == parent | ||
|
||
|
||
def test_dialog_actions_responses(): | ||
dialog = ConfirmInfoDialog() | ||
for expected in [Gtk.ResponseType.YES, Gtk.ResponseType.NO]: | ||
button = dialog.get_widget_for_response(expected) | ||
delayed_gui_action(button.clicked, delay=5) | ||
response = dialog.run() | ||
assert response == expected | ||
|
||
|
||
def test_load_path_action_list(): | ||
parent = Gtk.Window() | ||
widget = ConfirmInfoDialog(parent=parent) | ||
|
||
path_action_list = [("/tmp/fu.txt", "Add"), ("/tmp/bar.txt", "Del")] | ||
widget.load_path_action_list(path_action_list) | ||
|
||
# Verify the contents of the ConfirmInfoDialog.ListStore | ||
for i, j in zip(widget.changeStore, range(2)): | ||
# Note: tuples are reversed when loading Gtk.ListStore for display | ||
assert((i[1], i[0]) == path_action_list[j]) |
27 changes: 0 additions & 27 deletions
27
python/fapolicy_analyzer/tests/test_confirmation_dialog.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import gi | ||
gi.require_version("Gtk", "3.0") | ||
from gi.repository import Gtk | ||
import ui.strings as strings | ||
|
||
|
||
class ConfirmInfoDialog(Gtk.Dialog): | ||
def __init__(self, parent=None): | ||
Gtk.Dialog.__init__(self, strings.DEPLOY_ANCILLARY_CONFIRM_DIALOG_TITLE, | ||
transient_for=parent, flags=0) | ||
|
||
self.add_buttons(Gtk.STOCK_NO, | ||
Gtk.ResponseType.NO, | ||
Gtk.STOCK_YES, | ||
Gtk.ResponseType.YES) | ||
|
||
self.set_default_size(-1, 200) | ||
|
||
label = Gtk.Label(label=strings.DEPLOY_ANCILLARY_CONFIRM_DIALOG_TEXT) | ||
|
||
self.scrolled_window = Gtk.ScrolledWindow() | ||
self.changeStore = Gtk.ListStore(str, str) | ||
self.tree_view = Gtk.TreeView(model=self.changeStore) | ||
|
||
cellAction = Gtk.CellRendererText() | ||
cellAction.set_property("background", "light gray") | ||
columnAction = Gtk.TreeViewColumn(strings.DEPLOY_ANCILLARY_CONFIRM_DLG_ACTION_COL_HDR, | ||
cellAction, markup=0) | ||
self.tree_view.append_column(columnAction) | ||
columnAction.set_sort_column_id(0) | ||
|
||
cellFile = Gtk.CellRendererText() | ||
columnFile = Gtk.TreeViewColumn(strings.DEPLOY_ANCILLARY_CONFIRM_DLG_PATH_COL_HDR, | ||
cellFile, text=1) | ||
|
||
self.tree_view.append_column(columnFile) | ||
columnFile.set_sort_column_id(1) | ||
self.scrolled_window.add(self.tree_view) | ||
self.scrolled_window.set_policy(Gtk.PolicyType.NEVER, | ||
Gtk.PolicyType.ALWAYS) | ||
|
||
box = self.get_content_area() | ||
box.add(label) | ||
box.pack_start(self.scrolled_window, True, True, 0) | ||
|
||
self.show_all() | ||
|
||
def load_path_action_list(self, listPathActionPairs): | ||
if listPathActionPairs: | ||
for e in listPathActionPairs: | ||
# tuples are in (path,action) order, displayed as (action,path) | ||
self.changeStore.append(e[::-1]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters