def shutdown(self):
        self.shutdownEvt.wait()
        logger = serverLogging.logger
        logger.info('Initiating shutdown...')

        if self.running:
            logger.info('Shutting down main service...')
            asyncBaseServer.BaseServer.shutdown(self)

        # shutdown session manager
        if sessionManager.sm:
            logger.info('Closing session manager...')
            sessionManager.close()
        
        # close database
        if db.db_handle:
            logger.info('Closing database...')
            db.close()

        if Mgt.mgtServer:
            logger.info('Shutting down administation service')
            Mgt.mgtServer.shutdown()

        logger.info('All services have been shut down successfully')
        # shutdown logging
        logging.shutdown()
        self.shutdowninprogress = False
def close():
    sessionManager.close()
    db.close()
}

queryPerformer.applyPreferences = function(evt, w) {
    var win = w.getParentByType(Window);
    var appWin = win.opener;
    var ca = appWin.getWidgetById('clientArea');
    ca.attributes.tree_caption = win.getWidgetById('tree_caption').getValue();
    ca.attributes.use_image = win.getWidgetById('use_image').getValue();
    ca.attributes.tree_image = win.getWidgetById('tree_image').getValue();
    win.close();
}
    '''
    app.width.value = '600'
    app.height.value = '400'
    app.left.value = 'center'
    app.top.value = 'center'
    app.icon.value = 'images/oql.gif'
    app.resourcesImportPath.value = 'resources.system.strings.resources'
    app.isResizable.value = True
    app.canMaximize.value = True
    app.canMinimize.value = True
    app.inheritRoles = False
    app.security = {'administrators': 8}
    db.putItem(app, None)
    sys.stdout.write('[OK]\n')

    db.close()
    sys.stdout.write('Store initialization completed successfully.')

sys.exit()