Exemplo n.º 1
0
def run():
	""" Run application. """
	# parse options
	options = _parse_opt()

	# logowanie
	from wxgtd.lib.logging_setup import logging_setup
	logging_setup('wxgtd.log', options.debug, options.debug_sql)

	# app config
	from wxgtd.lib import appconfig
	config = appconfig.AppConfig('wxgtd.cfg', 'wxgtd')
	config.load_defaults(config.get_data_file('defaults.cfg'))
	config.load()
	config.debug = options.debug

	# importowanie wx
	try:
		import wxversion
		try:
			wxversion.ensureMinimal("2.8")
		except wxversion.AlreadyImportedError:
			_LOG.warn('Wx Already Imported')
		except wxversion.VersionError:
			_LOG.error("WX version > 2.8 not found; avalable: %s",
				wxversion.checkInstalled())
	except ImportError, err:
		_LOG.error('No wxversion.... (%s)' % str(err))
Exemplo n.º 2
0
def run():
	""" Run application. """
	# parse options
	options, args = _parse_opt()

	# app config
	from wxgtd.lib import appconfig

	# logowanie
	from wxgtd.lib.logging_setup import logging_setup
	logging_setup('wxgtd.log', options.debug, options.debug_sql)

	# konfiguracja
	config = appconfig.AppConfig('wxgtd.cfg', 'wxgtd')
	config.load_defaults(config.get_data_file('defaults.cfg'))
	config.load()
	config.debug = options.debug

	# locale
	from wxgtd.lib import locales
	locales.setup_locale(config)

	# database
	from wxgtd.model import db
	db_filename = db.find_db_file(config)
	# connect to databse
	db.connect(db_filename, options.debug_sql)

	if options.sync:
		_sync(config, True)
	if options.quick_task_title:
		from wxgtd.logic import quicktask as quicktask_logic
		quicktask_logic.create_quicktask(options.quick_task_title)
	elif options.query_group >= 0:
		_list_tasks(options, args)
	if options.sync:
		_sync(config, False)
	if options.shell:
		_shell()
	config.save()
	exit(0)