Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 15 → Rev 16

/trunk/basico/basico.py
12,7 → 12,9
from os.path import abspath, sep as SEP
from configparser import SafeConfigParser, ExtendedInterpolation
 
#~ from gi.repository import GObject
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
 
from .log import get_logger
from .gui import GUI
168,14 → 170,35
self.services[name] = None
 
 
def check_gtk_version(self):
vmajor = Gtk.get_major_version()
vminor = Gtk.get_minor_version()
vmicro = Gtk.get_micro_version()
self.log.info("Found GTK+ Version: %d.%d.%d" % (vmajor, vminor, vmicro))
 
if vmajor == 3 and vminor >= 18:
return True
else:
return False
 
def check(self):
sap = self.get_service('SAP')
found = sap.check_webdriver()
if not found:
self.log.error("No webdriver found. Exiting.")
return found
GTK_VERSION = self.check_gtk_version()
 
if GTK_VERSION:
self.log.debug("GTK+ version supported")
run = True
else:
self.log.error("Please, install a modern version of GTK+ (>= 3.18)")
run = False
 
return run
#~ sap = self.get_service('SAP')
#~ found = sap.check_webdriver()
#~ if not found:
#~ self.log.error("No webdriver found. Exiting.")
#~ return found
 
 
def stop(self):
"""For each service registered, it executes the 'end' method
(if any) to finalize them properly.
209,7 → 232,7
#DOC: http://stackoverflow.com/questions/16410852/keyboard-interrupt-with-with-python-gtk
signal.signal(signal.SIGINT, signal.SIG_DFL)
basico = Basico()
run = True #basico.check()
run = basico.check()
if run:
basico.run()
sys.exit(0)