Skip to content

Commit

Permalink
If we are in ssh, you can't launch alignak-app
Browse files Browse the repository at this point in the history
Refs #8 now test we are in desktop_session
  • Loading branch information
algorys committed Jul 14, 2016
1 parent b8324c7 commit 663719b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions alignak_app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ def update_hosts_menu(self, hosts_states, services_states):
:param hosts_states: number of hosts UP or DOWN
:param services_states: number of services UP, UNKNOWN or DOWN
"""
assert isinstance(self.hosts_up_item, Gtk.ImageMenuItem)
assert isinstance(self.services_up_item, Gtk.ImageMenuItem)

self.hosts_up_item.set_label(
'Hosts UP (' + str(hosts_states['up']) + ')')
self.hosts_down_item.set_label(
Expand Down
10 changes: 9 additions & 1 deletion alignak_app/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@
# You should have received a copy of the GNU Affero General Public License
# along with (AlignakApp). If not, see <http://www.gnu.org/licenses/>.

from alignak_app.application import AlignakApp as App
import os, sys

from alignak_app.application import AlignakApp as App

def launch():
"""
Launch Alignak-App.
"""
# Actually, we must verify we are in DESKTOP_SESSION or not
try:
os.environ['DESKTOP_SESSION']
except KeyError as e:
sys.exit('--> ERROR: you must be in desktop session to launch alignak-app : ' + str(e))

App().run()


if __name__ == "__main__":
launch()

0 comments on commit 663719b

Please sign in to comment.