def ub_set_mode(): '''Set editor mode according to the option ub_editor_mode ''' editor_mode = util.ub_get_option('ub_editor_mode') if '1' == editor_mode: Session.configure(bind=db) Base.metadata.create_all(db) ub_init_template()
def ub_set_mode(db): '''Set editor mode according to the option ub_editor_mode ''' editor_mode = u.ub_get_option('ub_editor_mode') if '1' == editor_mode: Session.configure(bind=db) Base.metadata.create_all(db) ub_init_template()
editor_mode = u.ub_get_option('ub_editor_mode') if '1' == editor_mode: Session.configure(bind=db) Base.metadata.create_all(db) ub_init_template() cfg = None try: cfg = u.ub_get_blog_settings() except KeyError, e: msg = _('Missing key %s in the settings list of UltraBlog.vim !') % str(e) u.ub_echoerr(msg) except: pass try: socket.setdefaulttimeout(u.ub_get_option('ub_socket_timeout')) api = xmlrpclib.ServerProxy(cfg.xmlrpc) dbe = sqlalchemy.create_engine("sqlite:///%s" % cfg.dbf) dbe.echo = u.ub_get_option('ub_debug') Session.configure(bind=dbe) Base.metadata.create_all(dbe) ub_upgrade(dbe) ub_init_template() except: api = None dbe = None
''' editor_mode = u.ub_get_option('ub_editor_mode') if '1' == editor_mode: Session.configure(bind=db) Base.metadata.create_all(db) ub_init_template() cfg = None try: cfg = u.ub_get_blog_settings() except KeyError,e: msg = _('Missing key %s in the settings list of UltraBlog.vim !') % str(e) u.ub_echoerr(msg) except: pass try: socket.setdefaulttimeout(u.ub_get_option('ub_socket_timeout')) api = xmlrpclib.ServerProxy(cfg.xmlrpc) dbe = sqlalchemy.create_engine("sqlite:///%s" % cfg.dbf) dbe.echo = u.ub_get_option('ub_debug') Session.configure(bind=dbe) Base.metadata.create_all(dbe) ub_upgrade(dbe) ub_init_template() except: api = None dbe = None