Example #1
0
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()
Example #2
0
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()
Example #3
0
    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
Example #4
0
    '''
    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