diff options
author | 2017-02-01 17:01:47 +0200 | |
---|---|---|
committer | 2017-02-01 17:09:52 +0200 | |
commit | 693e822b3779d695677d5bdc55a6b87e359285a9 (patch) | |
tree | 1b89f8aed136b9d71bef9ad63bfccfa54c5a2e25 /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils | |
parent | c55f150ece248b4439e188cb9c1d9ff3c547b5c2 (diff) |
added tests for capture
few tweaks
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py index 72d3fa9f..7cb94b28 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py @@ -124,6 +124,32 @@ def bitfield_to_list (bf): return rc +def set_window_always_on_top (title): + # we need the GDK module, if not available - ignroe this command + try: + if sys.version_info < (3,0): + from gtk import gdk + else: + #from gi.repository import Gdk as gdk + return + + except ImportError: + return + + # search the window and set it as above + root = gdk.get_default_root_window() + + for id in root.property_get('_NET_CLIENT_LIST')[2]: + w = gdk.window_foreign_new(id) + if w: + name = w.property_get('WM_NAME')[2] + if title in name: + w.set_keep_above(True) + gdk.window_process_all_updates() + break + + def bitfield_to_str (bf): lst = bitfield_to_list(bf) return "-" if not lst else ', '.join([str(x) for x in lst]) + |