diff options
author | Nicolargo <nicolas@nicolargo.com> | 2014-08-16 15:05:42 +0200 |
---|---|---|
committer | Nicolargo <nicolas@nicolargo.com> | 2014-08-16 15:05:42 +0200 |
commit | 5ec391474e8b6a84c7b84062f691540130cbe4c0 (patch) | |
tree | be743281878af231c0ef495b41d540c4016728eb | |
parent | 32190fedee931f7988796978c1bb20edc413c15e (diff) |
Limit process filter to standalone mode
-rw-r--r-- | glances/core/glances_main.py | 9 | ||||
-rw-r--r-- | glances/outputs/glances_curses.py | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/glances/core/glances_main.py b/glances/core/glances_main.py index b7c58eb7..e8928b37 100644 --- a/glances/core/glances_main.py +++ b/glances/core/glances_main.py @@ -21,6 +21,7 @@ # Import system libs import argparse +import sys # Import Glances libs from glances.core.glances_config import Config @@ -174,6 +175,14 @@ class GlancesMain(object): args.network_sum = False args.network_cumul = False + # Control parameter and exit if it is not OK + self.args = args + + # Filter is only available in standalone mode + if args.process_filter is not None and not self.is_standalone(): + logger.critical(_("Process filter is only available in standalone mode")) + sys.exit(2) + return args def __hash_password(self, plain_password): diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index e4dc0823..fb4487b7 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -483,11 +483,14 @@ class GlancesCurses(object): self.reset_history_tag = False # Display edit filter popup - if self.edit_filter: + # Only in standalone mode (cs_status == 'None') + if self.edit_filter and cs_status == 'None': new_filter = self.display_popup(_("Process filter pattern: "), is_input=True, input_value=glances_processes.get_process_filter()) glances_processes.set_process_filter(new_filter) + elif self.edit_filter and cs_status != 'None': + self.display_popup(_("Process filter only available in standalone mode")) self.edit_filter = False return True |