# Path: kano/utils/shell.py
# def restore_signals():
#     signals = ('SIGPIPE', 'SIGXFZ', 'SIGXFSZ')
#     for sig in signals:
#         if hasattr(signal, sig):
#             signal.signal(getattr(signal, sig), signal.SIG_DFL)


import os
import subprocess
from kano.utils.shell import restore_signals
# gui.py
#
# Copyright (C) 2014-2016 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Utilities relating to UI





def is_gui():
    return 'DISPLAY' in os.environ


def zenity_show_progress(msg, title=None):
    if title is None:
        title = ''
    if is_gui():
        cmd = 'yes | zenity --progress --text="{}" --pulsate --no-cancel ' + \

# Path: kano/utils/shell.py
# def restore_signals():
#     signals = ('SIGPIPE', 'SIGXFZ', 'SIGXFSZ')
#     for sig in signals:
#         if hasattr(signal, sig):
#             signal.signal(getattr(signal, sig), signal.SIG_DFL)


# Path: kano/utils/gui.py
import os
import subprocess
from kano.utils.shell import restore_signals

# gui.py
#
# Copyright (C) 2014-2016 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Utilities relating to UI





def is_gui():
    return 'DISPLAY' in os.environ


def zenity_show_progress(msg, title=None):
    if title is None:
        title = ''
    if is_gui():
        cmd = 'yes | zenity --progress --text="{}" --pulsate --no-cancel ' + \

              '--auto-close --title="{}"'