Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 295 → Rev 296

/branches/BR-0.3/basico/core/mod_srv.py
15,8 → 15,6
 
 
class Service(object):
# ~ logger = None
 
"""
Service class is the base class for those modules acting as services.
Different modules (GUI, Database, Ask, etc...) share same methods
/branches/BR-0.3/basico/core/mod_wdg.py
0,0 → 1,43
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
# File: mod_wdg.py
# Author: Tomás Vírseda
# License: GPL v3
# Description: Basico Widget Base class
"""
 
import sys
import traceback as tb
 
from basico.core.mod_env import FILE
from basico.core.mod_log import get_logger
 
 
class BasicoWidget(object):
"""
Service class is the base class for Basico widgets.
"""
log=None
def __init__(self, app, logname):
"""Initialize Service instance
@type app: Basico instance
@param app: current Basico instance reference
"""
if app is not None:
self.app = app
self.log = get_logger(logname)
 
 
 
def init_section(self, name):
"""Check if section exists in config. If not, create it"""
self.srvstg = self.app.get_service('Settings')
config = self.srvstg.load()
try:
config['Widgets']
except:
config['Widgets'] = {}
self.srvstg.save(config)
self.log.debug("Section '%s' initialized in config file" % section)
/branches/BR-0.3/basico/core/mod_win.py
679,7 → 679,7
def setup_stack_about(self):
box = Gtk.VBox()
box.set_hexpand(True)
about = self.srvgui.add_widget('widget_about', About())
about = self.srvgui.add_widget('widget_about', About(self.controller))
box.pack_start(about, True, True, 0)
box.show_all()
return box
/branches/BR-0.3/basico/widgets/wdg_about.py
13,15 → 13,18
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk
from gi.repository import Pango
from basico.core.mod_wdg import BasicoWidget
from basico.core.mod_env import APP
 
 
class About(Gtk.ScrolledWindow):
class About(BasicoWidget, Gtk.ScrolledWindow):
"""
About class
"""
def __init__(self):
def __init__(self, app):
super().__init__(app, __class__.__name__)
Gtk.ScrolledWindow.__init__(self)
self.log.debug("Loading About Widget")
self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.set_hexpand(True)
self.set_vexpand(True)