Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 125 → Rev 126

/branches/BR-0.3/basico/basico.py
15,7 → 15,7
from pprint import pprint
from os.path import abspath, sep as SEP
from configparser import SafeConfigParser, ExtendedInterpolation
# import urllib.request
from datetime import datetime
 
import selenium
 
42,7 → 42,7
from .database import Database
#~ from .webserver import WebServer
from .driver import SeleniumDriver
from .env import ROOT, APP, LPATH, GPATH, FILE
from .env import ROOT, APP, LPATH, GPATH, FILE, STATS
 
 
class Basico:
50,6 → 50,7
"""Main class: the entry point for Basico.
It stands for Controller.
"""
STATS['BASICO_STARTUP_START'] = datetime.now()
 
# Create local paths if they do not exist
for entry in LPATH:
58,7 → 59,7
 
 
self.log = get_logger(self.__class__.__name__, FILE['LOG'])
#~ self.log.info("Starting Basico")
self.log.info("Starting Basico")
 
self.services = {}
try:
72,7 → 73,7
'Notify' : Notification(),
'Tasks' : Tasks(),
'IM' : IconManager(),
'Plugins' : Plugins(),
#~ 'Plugins' : Plugins(),
'Callbacks' : Callback(),
'Workplace' : Workplace(),
'Stats' : Stats(),
98,24 → 99,24
self.log.debug("Global path: %s" % GPATH['ROOT'])
self.log.debug("Local path: %s" % LPATH['ROOT'])
 
# Set up config
CONFIG_FILE = self.get_file('CNF')
self.config = SafeConfigParser(interpolation=ExtendedInterpolation())
self.config.optionxform = str
#~ # Set up config
#~ CONFIG_FILE = self.get_file('CNF')
#~ self.config = SafeConfigParser(interpolation=ExtendedInterpolation())
#~ self.config.optionxform = str
 
# Save config
if not os.path.exists(CONFIG_FILE):
self.log.debug('Configuration file not found. Creating a new one')
with open(CONFIG_FILE, 'w') as configfile:
self.config.write(configfile)
self.log.info('Config file initialited')
#~ # Save config
#~ if not os.path.exists(CONFIG_FILE):
#~ self.log.debug('Configuration file not found. Creating a new one')
#~ with open(CONFIG_FILE, 'w') as configfile:
#~ self.config.write(configfile)
#~ self.log.info('Config file initialited')
 
 
def get_config(self):
CONFIG_FILE = self.get_file('CNF')
self.config.read(CONFIG_FILE)
#~ def get_config(self):
#~ CONFIG_FILE = self.get_file('CNF')
#~ self.config.read(CONFIG_FILE)
 
return self.config
#~ return self.config
 
 
def get_file(self, name):
/branches/BR-0.3/basico/callbacks.py
42,6 → 42,7
self.get_services()
 
def get_services(self):
self.settings = self.app.get_service('Settings')
self.db = self.app.get_service('DB')
self.gui = self.app.get_service('GUI')
self.uif = self.app.get_service("UIF")
64,7 → 65,7
 
 
def actions_browse(self, *args):
SAP_NOTE_URL = self.sap.get_config_value('CNF_SAP_NOTE_URL')
SAP_NOTE_URL = self.settings.get('SAP', 'SAP_NOTE_URL')
sapnoteview = self.gui.get_widget('viewmenu')
sapnotes = sapnoteview.get_selected_notes()
lurl = []
711,12 → 712,12
self.log.debug("Settings reverted to default")
 
 
def apply_preferences(self, *args):
self.sap.apply_preferences()
notebook = self.gui.get_widget('notebook')
notebook.set_current_page(0)
self.refresh_view(view='tasks')
self.alert.show('Settings', 'SAP preferences saved', 'information')
#~ def apply_preferences(self, *args):
#~ self.sap.apply_preferences()
#~ notebook = self.gui.get_widget('notebook')
#~ notebook.set_current_page(0)
#~ self.refresh_view(view='tasks')
#~ self.alert.show('Settings', 'SAP preferences saved', 'information')
 
 
def update_components_stats(self, *args):
/branches/BR-0.3/basico/data/ui/basico.ui
1,5 → 1,5
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3
<!-- Generated with glade 3.18.3
 
Copyright (C) 2016-2017
 
1514,7 → 1514,6
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">select.png</property>
</object>
</child>
</object>
/branches/BR-0.3/basico/database.py
113,7 → 113,7
alltasks.add(task)
except: pass
self.tasks = self.app.get_service('Tasks')
self.tasks.save_tasks_from_stats(alltasks)
#~ self.tasks.save_tasks_from_stats(alltasks)
 
# components
compkey = self.sapnotes[sid]['componentkey']
/branches/BR-0.3/basico/driver.py
92,7 → 92,7
GECKODRIVER = utils.which('geckodriver')
 
if not GECKODRIVER:
self.log.debug("Attempting to download and install it.")
self.log.debug("Attempting to download Gecko driver and install it.")
utils.install_geckodriver()
 
GECKODRIVER = utils.which('geckodriver')
/branches/BR-0.3/basico/env.py
22,6 → 22,7
APP['documenters'] = ["Tomás Vírseda <tomasvirseda@gmail.com>"]
APP['email'] = "t00m@t00mlabs.net"
 
 
# Local paths
LPATH = {}
LPATH['ROOT'] = USER_DIR + SEP + '.basico' + SEP
56,8 → 57,11
FILE['LOG'] = LPATH['LOG'] + 'basico.log'
FILE['CREDITS'] = GPATH['DOC'] + 'CREDITS'
 
# APP STATS
STATS = {}
 
# SAP related
SAP = {}
SAP['NOTE_URL'] = "https://launchpad.support.sap.com/#/notes/%s"
SAP['ODATA_NOTE_URL'] = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
#~ SAP = {}
#~ SAP['NOTE_URL'] = "https://launchpad.support.sap.com/#/notes/%s"
#~ SAP['ODATA_NOTE_URL'] = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
 
/branches/BR-0.3/basico/gui.py
23,6 → 23,7
 
from .service import Service
from .uiapp import UIApp
from .env import STATS
 
 
class GUI(Service):
51,6 → 52,9
GObject.threads_init()
self.sap.run()
self.ui = UIApp(self.app)
DEBUG_END_TIME = datetime.now()
STATS['BASICO_STARTUP_END'] = datetime.now()
self.log.debug("Startup duration: %s" % (STATS['BASICO_STARTUP_END'] - STATS['BASICO_STARTUP_START']))
self.ui.run()
 
 
/branches/BR-0.3/basico/iconmanager.py
17,22 → 17,6
from .service import Service
 
 
def resource_filename(file_name):
paths = map(
lambda path: os.path.join(path, file_name),
(
'/opt/extras.ubuntu.com/',
'/usr/local/',
'/usr/',
),
)
for path in paths:
if os.path.isfile(path):
return path
return pkg_resources.resource_filename(
pkg_resources.Requirement.parse("basico"), file_name)
 
 
class IconManager(Service):
def initialize(self):
APP_DIR_ICONS = self.app.get_var('ICONS')
41,6 → 25,7
self.theme = Gtk.IconTheme.get_default()
self.theme.prepend_search_path (APP_DIR_ICONS)
 
 
def get_themed_icon(self, icon_name):
APP_DIR_ICONS = self.app.get_var('ICONS')
ICON = APP_DIR_ICONS + icon_name + '.png'
63,7 → 48,7
icon = iconinfo.load_icon()
#~ print ("ICON EXCEPT: %s: %s" % (type(icon), icon))
self.icondict[key] = icon
#~ icon = None
 
return icon
 
 
94,5 → 79,4
icon.set_from_pixbuf(pixbuf)
self.imgdict[key] = icon
 
#~ self.log.debug(type(icon))
return icon
/branches/BR-0.3/basico/projects.py
141,6 → 141,7
 
 
def get_services(self):
self.settings = self.app.get_service('Settings')
self.gui = self.app.get_service("GUI")
self.sap = self.app.get_service('SAP')
self.uif = self.app.get_service('UIF')
213,7 → 214,7
 
def load_projects(self, sapnote=''):
try:
projects = self.get_config_value('Projects').split(',')
projects = self.settings.get('Basico', 'Projects').split(',')
except:
projects = []
model = self.treeview.get_model()
236,6 → 237,6
settings = {}
projects = self.get_all_projects()
 
settings['Projects'] = ','.join(projects)
self.config[self.section] = settings
self.save_config()
#~ settings['Projects'] = ','.join(projects)
#~ self.config[self.section] = settings
#~ self.save_config()
/branches/BR-0.3/basico/sap.py
12,13 → 12,17
from .service import Service
 
#~ ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='en')"
ODATA_NOTE_URL_LONGTEXT = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='0000000001',Version='0',Language='E')/LongText"
#~ ODATA_NOTE_URL_LONGTEXT = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='0000000001',Version='0',Language='E')/LongText"
#~ ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')?$expand=LongText,Languages,RefTo,RefBy"
#~ ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')?$expand=LongText,Languages,RefTo,RefBy"
 
# Default settings for SAP module
LOGIN_PAGE_URL = "https://accounts.sap.com"
LOGOUT_PAGE_URL = "https://accounts.sap.com/ui/logout"
ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
SAP_NOTE_URL = "https://launchpad.support.sap.com/#/notes/%s"
SAP_NOTE_URL_PDF = "https://launchpad.support.sap.com/services/pdf/notes/%s/E"
TIMEOUT = 5
 
"""
<link href="TrunkSet(SapNotesNumber='0002258035',Version='4',Language='E')/RefBy"
41,24 → 45,46
'''
Setup AppLogic Service
'''
self.settings = self.get_service('Settings')
self.__init_config_section()
 
 
def __init_config_section(self):
prefs = self.get_service('Settings')
self.config = self.app.get_config()
if self.config.has_section(self.section):
options = self.config.options(self.section)
if len(options) == 0:
self.log.debug("Section %s empty. Initializing with default values" % self.section)
settings = prefs.get_default_settings()
self.config[self.section] = settings
self.log.debug("Default parameters loaded:")
for key in settings:
self.log.debug("\tKey: %s - Value: %s" % (key, settings[key]))
self.save_config()
settings = self.settings.load()
settings[self.section]
try:
settings[self.section]['LOGIN_PAGE_URL']
except:
settings[self.section]['LOGIN_PAGE_URL'] = LOGIN_PAGE_URL
 
try:
settings[self.section]['LOGOUT_PAGE_URL']
except:
settings[self.section]['LOGOUT_PAGE_URL'] = LOGOUT_PAGE_URL
 
try:
settings[self.section]['ODATA_NOTE_URL']
except:
settings[self.section]['ODATA_NOTE_URL'] = ODATA_NOTE_URL
 
try:
settings[self.section]['SAP_NOTE_URL']
except:
settings[self.section]['SAP_NOTE_URL'] = SAP_NOTE_URL
 
try:
settings[self.section]['SAP_NOTE_URL_PDF']
except:
settings[self.section]['SAP_NOTE_URL_PDF'] = SAP_NOTE_URL_PDF
 
try:
settings[self.section]['TIMEOUT']
except:
settings[self.section]['TIMEOUT'] = TIMEOUT
 
self.settings.save(settings)
 
 
def analyze_sapnote_metadata(self, sid, content):
'''
Get metadata details from SAP Note
122,18 → 148,18
 
 
 
def apply_preferences(self, *args):
self.gui = self.app.get_service('GUI')
settings = self.get_default_settings()
new_settings = {}
for key in settings:
widget = self.gui.get_widget(key)
value = widget.get_text()
new_settings[key] = value
#~ def apply_preferences(self, *args):
#~ self.gui = self.app.get_service('GUI')
#~ settings = self.get_default_settings()
#~ new_settings = {}
#~ for key in settings:
#~ widget = self.gui.get_widget(key)
#~ value = widget.get_text()
#~ new_settings[key] = value
#~ self.log.debug(new_settings)
self.config[self.section] = new_settings
self.save_config()
self.log.debug("Settings saved")
#~ self.config[self.section] = new_settings
#~ self.save_config()
#~ self.log.debug("Settings saved")
 
 
def start_fetching(self, total):
156,6 → 182,7
#~ browser = driver.open()
#~ self.log.debug("\tDownloading SAP Note %s:" % sapnote)
#~ self.log.debug(ODATA_NOTE_URL % sapnote)
ODATA_NOTE_URL = self.settings.get('SAP', 'ODATA_NOTE_URL')
browser = driver.load(ODATA_NOTE_URL % sapnote)
time.sleep(10)
content = browser.page_source
/branches/BR-0.3/basico/sapnoteview.py
247,7 → 247,7
self.sap = self.app.get_service('SAP')
self.im = self.app.get_service('IM')
self.settings = self.app.get_service('Settings')
self.plugins = self.app.get_service('Plugins')
#~ self.plugins = self.app.get_service('Plugins')
self.db = self.app.get_service('DB')
 
 
/branches/BR-0.3/basico/sapnoteviewmenu.py
70,19 → 70,20
#~ selection = treeview.get_selection()
model, treeiters = selection.get_selected() #_rows()
#~ self.log.debug("%s - %s - %s" % (model, selection, treeiters))
visor = self.gui.get_widget('visor')
try:
row = model[treeiters][0]
row_type, sid = row.split('@')
self.log.debug("%s (%s)" % (row_type, sid))
matches = self.db.get_notes_by_node(row_type, sid)
visor = self.gui.get_widget('visor')
#~ self.log.debug("Populating visor with %d SAP Notes" % len(matches))
visor.populate(matches)
except:
self.log.error(tb.format_exc())
pass
#~ self.log.error(tb.format_exc())
#~ pass
visor.populate([])
 
return False
#~ return False
 
 
def right_click(self, treeview, event, data=None):
/branches/BR-0.3/basico/sapnoteviewrow.py
42,7 → 42,7
self.sap = self.app.get_service('SAP')
self.im = self.app.get_service('IM')
self.settings = self.app.get_service('Settings')
self.plugins = self.app.get_service('Plugins')
#~ self.plugins = self.app.get_service('Plugins')
self.db = self.app.get_service('DB')
self.uif = self.app.get_service("UIF")
 
/branches/BR-0.3/basico/sapnoteviewvisor.py
45,7 → 45,7
self.sap = self.app.get_service('SAP')
self.im = self.app.get_service('IM')
self.settings = self.app.get_service('Settings')
self.plugins = self.app.get_service('Plugins')
#~ self.plugins = self.app.get_service('Plugins')
self.db = self.app.get_service('DB')
self.uif = self.app.get_service("UIF")
 
/branches/BR-0.3/basico/service.py
9,8 → 9,8
import traceback as tb
 
from .log import get_logger
from .env import FILE
 
 
class Service(object):
"""
Service class is the base class for the rest of main classes used in
51,9 → 51,9
self.app = app
logfile = self.app.get_file('LOG')
self.log = get_logger(logname, logfile)
self.config = self.app.get_config()
#~ self.config = self.app.get_config()
self.section = logname
self.init_section(logname)
self.init_section(self.section)
 
try:
self.initialize()
99,45 → 99,42
pass
 
 
def get_config_value(self, key):
"""Get value for a given param in section for this service
@type param: string
@param param: parameter name
"""
self.config = self.app.get_config()
if self.config.has_section(self.section):
if self.config.has_option(self.section, key):
return self.config.get(self.section, key)
#~ def get_config_value(self, key):
#~ """Get value for a given param in section for this service
#~ @type param: string
#~ @param param: parameter name
#~ """
#~ self.config = self.app.get_config()
#~ if self.config.has_section(self.section):
#~ if self.config.has_option(self.section, key):
#~ return self.config.get(self.section, key)
 
return None
#~ return None
 
 
def set_config_value(self, key, value):
"""Set value for a given param in section for this service
@type param: string
@param param: parameter name
@type value: string
@param param: new value for this parameter
"""
self.config[self.section][key] = value
self.log.debug("CONFIG[%s][%s] = %s" % (self.section, key, value))
self.save_config()
#~ def set_config_value(self, key, value):
#~ """Set value for a given param in section for this service
#~ @type param: string
#~ @param param: parameter name
#~ @type value: string
#~ @param param: new value for this parameter
#~ """
#~ self.config[self.section][key] = value
#~ self.log.debug("CONFIG[%s][%s] = %s" % (self.section, key, value))
#~ self.save_config()
 
 
def init_section(self, section):
"""Check if section exists in config. If not, create it"""
if not self.config.has_section(section):
self.config.add_section(section)
self.log.debug("CONFIG[%s] section created" % section)
self.save_config()
self.settings = self.app.get_service('Settings')
config = self.settings.load()
try:
config[section]
except:
config[section] = {}
self.settings.save(config)
self.log.debug("Section '%s' initialized in config file" % section)
 
 
def save_config(self):
CONFIG_FILE = self.get_file('CNF')
with open(CONFIG_FILE, 'w') as configfile:
self.config.write(configfile)
 
 
def get_traceback(self):
return self.app.get_traceback()
 
/branches/BR-0.3/basico/settings.py
11,53 → 11,103
from gi.repository import Pango
from gi.repository.GdkPixbuf import Pixbuf
 
import json
 
from .service import Service
from .env import FILE
 
# Default settings for SAP module
LOGIN_PAGE_URL = "https://accounts.sap.com"
LOGOUT_PAGE_URL = "https://accounts.sap.com/ui/logout"
ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
SAP_NOTE_URL = "https://launchpad.support.sap.com/#/notes/%s"
SAP_NOTE_URL_PDF = "https://launchpad.support.sap.com/services/pdf/notes/%s/E"
TIMEOUT = 5
#~ # Default settings for SAP module
#~ LOGIN_PAGE_URL = "https://accounts.sap.com"
#~ LOGOUT_PAGE_URL = "https://accounts.sap.com/ui/logout"
#~ ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
#~ SAP_NOTE_URL = "https://launchpad.support.sap.com/#/notes/%s"
#~ SAP_NOTE_URL_PDF = "https://launchpad.support.sap.com/services/pdf/notes/%s/E"
#~ TIMEOUT = 5
 
 
class Settings(Service):
######
# FIXME: right now, settings are hardcoded
######
def initialize(self):
view = self.get_config_value('View')
self.log.debug("View: %s" % view)
self.log.debug("Basico config file: %s" % FILE['CNF'])
self.load()
 
def get_default_settings(self):
settings = {}
utils = self.get_service('Utils')
settings['CNF_SAP_LOGIN'] = LOGIN_PAGE_URL
settings['CNF_SAP_LOGOUT'] = LOGOUT_PAGE_URL
settings['CNF_SAP_ODATA_NOTES'] = ODATA_NOTE_URL
settings['CNF_SAP_NOTE_URL'] = SAP_NOTE_URL
settings['CNF_SAP_CONN_TIMEOUT'] = TIMEOUT
settings['CNF_FF_PROFILE_DIR'] = utils.get_firefox_profile_dir()
def get(self, section, key):
config = self.load()
try:
value = config[section][key]
self.log.debug("[%s][%s] = %s" % (section, key, value))
return value
except:
self.log.debug("[%s][%s] = None" % (section, key))
return None
 
return settings
def set(self, section, key, value):
config = self.load()
try:
config[section][key] = value
self.save(config)
except:
self.log.error("Setting not saved")
self.log.error(self.get_traceback())
 
 
def get_custom_settings(self):
sap = self.get_service('SAP')
utils = self.get_service('Utils')
def load(self):
try:
with open(FILE['CNF'], 'r') as fp:
config = json.load(fp)
except Exception as error:
self.log.info("Config file not found. Creating a new one")
config = {}
self.save(config)
 
settings = {}
settings['CNF_SAP_LOGIN'] = sap.get_config_value('CNF_SAP_LOGIN')
settings['CNF_SAP_LOGOUT'] = sap.get_config_value('CNF_SAP_LOGOUT')
settings['CNF_SAP_ODATA_NOTES'] = sap.get_config_value('CNF_SAP_ODATA_NOTES')
settings['CNF_SAP_NOTE_URL'] = sap.get_config_value('CNF_SAP_NOTE_URL')
settings['CNF_SAP_CONN_TIMEOUT'] = sap.get_config_value('CNF_SAP_CONN_TIMEOUT')
settings['CNF_FF_PROFILE_DIR'] = sap.get_config_value('CNF_FF_PROFILE_DIR')
return config
 
return settings
 
def save(self, config=None):
if config is None:
self.log.error("A dictionary with all settings must be provided")
return
with open(FILE['CNF'], 'w') as fp:
json.dump(config, fp)
self.log.debug("Settings saved successfully")
 
 
 
#~ class Settings(Service):
#~ ######
#~ # FIXME: right now, settings are hardcoded
#~ ######
#~ def initialize(self):
#~ view = self.get_config_value('View')
#~ self.log.debug("View: %s" % view)
 
#~ def get_default_settings(self):
#~ settings = {}
#~ utils = self.get_service('Utils')
#~ settings['CNF_SAP_LOGIN'] = LOGIN_PAGE_URL
#~ settings['CNF_SAP_LOGOUT'] = LOGOUT_PAGE_URL
#~ settings['CNF_SAP_ODATA_NOTES'] = ODATA_NOTE_URL
#~ settings['CNF_SAP_NOTE_URL'] = SAP_NOTE_URL
#~ settings['CNF_SAP_CONN_TIMEOUT'] = TIMEOUT
#~ settings['CNF_FF_PROFILE_DIR'] = utils.get_firefox_profile_dir()
 
#~ return settings
 
 
#~ def get_custom_settings(self):
#~ sap = self.get_service('SAP')
#~ utils = self.get_service('Utils')
 
#~ settings = {}
#~ settings['CNF_SAP_LOGIN'] = sap.get_config_value('CNF_SAP_LOGIN')
#~ settings['CNF_SAP_LOGOUT'] = sap.get_config_value('CNF_SAP_LOGOUT')
#~ settings['CNF_SAP_ODATA_NOTES'] = sap.get_config_value('CNF_SAP_ODATA_NOTES')
#~ settings['CNF_SAP_NOTE_URL'] = sap.get_config_value('CNF_SAP_NOTE_URL')
#~ settings['CNF_SAP_CONN_TIMEOUT'] = sap.get_config_value('CNF_SAP_CONN_TIMEOUT')
#~ settings['CNF_FF_PROFILE_DIR'] = sap.get_config_value('CNF_FF_PROFILE_DIR')
 
#~ return settings
 
 
#~ def get_value(self, key):
#~ settings = self.get_custom_settings()
 
/branches/BR-0.3/basico/tasks.py
324,9 → 324,9
 
 
 
def save_tasks_from_stats(self, alltasks):
settings = {}
tasks = ','.join(alltasks)
settings['Tasks'] = tasks
self.config[self.section] = settings
self.save_config()
#~ def save_tasks_from_stats(self, alltasks):
#~ settings = {}
#~ tasks = ','.join(alltasks)
#~ settings['Tasks'] = tasks
#~ self.config[self.section] = settings
#~ self.save_config()
/branches/BR-0.3/basico/utils.py
59,10 → 59,10
"""Get last version of Gecko webdriver from github"""
self.log.debug("OS Platform: %s" % sys.platform)
if sys.platform in ['linux', 'linux2']:
GECKO_SOURCE = "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
GECKO_SOURCE = "https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz"
GECKO_TARGET = self.get_var('TMP', scope='local') + 'gecko.tar.gz'
elif sys.platform == 'win32':
GECKO_SOURCE = "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-win64.zip"
GECKO_SOURCE = "https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-win64.zip"
GECKO_TARGET = self.get_var('TMP', scope='local') + 'gecko.zip'
 
GECKO_INSTALL_DIR = self.get_var('DRIVERS', 'local')
/branches/BR-0.3/basico/window.py
403,7 → 403,7
button.connect('clicked', self.cb.show_workplace)
 
button = self.gui.add_widget('btnPrefsSAPApply')
button.connect('clicked', self.cb.apply_preferences)
#~ button.connect('clicked', self.cb.apply_preferences)
 
button = self.gui.add_widget('btnPrefsSAPCancel')
button.connect('clicked', self.cb.refresh_view)
/branches/BR-0.3/setup.py
62,8 → 62,8
'basico/data/icons/power.png',
'basico/data/icons/workplace.png',
'basico/data/icons/comments.png',
'basico/data/icons/select.png',
'basico/data/icons/school.png',
'basico/data/icons/select.png',
'basico/data/icons/unfullscreen.png',
'basico/data/icons/fullscreen.png',
'basico/data/icons/bookmark_off.png',