~ubuntu-branches/ubuntu/precise/gui-ufw/precise

« back to all changes in this revision

Viewing changes to gufw.py

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2009-06-03 20:34:27 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603203427-gx5zxtmvrkvel9iv
Tags: 9.10.0~bzr23-0ubuntu1
* New upstream release (LP: #383279).
* debian/control: bump Standards-Version to 3.8.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
 
# Gufw 9.04.0 - http://gufw.tuxfamily.org
 
2
# Gufw 9.10.0 - http://gufw.tuxfamily.org
3
3
# Copyright (C) 2009 Marcos Alvarez Costales
4
4
#
5
5
# Gufw is free software; you can redistribute it and/or modify
17
17
# information.
18
18
 
19
19
 
 
20
import view.guiGufw
 
21
from instance   import Instance
 
22
from instance   import Check
20
23
from controller import Controller 
21
 
import view.guiGufw
22
 
import os, gtk
23
 
from model.Variable import Variable
24
24
 
25
25
 
26
26
if __name__ == "__main__":
27
27
 
28
28
    # Is root?
29
 
    variable = Variable()
30
 
    if os.geteuid() != 0:
31
 
        dlg = gtk.MessageDialog(None, buttons=gtk.BUTTONS_CLOSE, message_format=variable.get_text("018"))
32
 
        dlg.run()
33
 
        dlg.destroy()
34
 
        
35
 
    # Show GUI
36
 
    else:
 
29
    check = Check()
 
30
    
 
31
    if check.is_root():
 
32
    
 
33
        # Check wether there a instance exists or we create a new one
 
34
        appInstance = Instance()
 
35
 
 
36
        # Show GUI
37
37
        controler = Controller()
 
38
        
38
39
        firewall  = controler.get_firewall()
39
 
        app       = view.guiGufw.Guigufw(firewall)
40
 
    
 
40
        variable  = controler.get_variable()
 
41
        
 
42
        app = view.guiGufw.Guigufw(variable, firewall)
 
43
 
 
44
        # Remove current instance
 
45
        appInstance.exitApplication()
 
46