Beispiel #1
0
            sess.close()


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()


cfg = None
try:
    cfg = util.ub_get_blog_settings()
except KeyError, e:
    print >> sys.stdout, 'Missing key %s in the settings list of UltraBlog.vim !' % str(
        e)
except:
    pass

try:
    api = xmlrpclib.ServerProxy(cfg.xmlrpc)
    db = sqlalchemy.create_engine("sqlite:///%s" % cfg.dbf)

    Session.configure(bind=db)
    Base.metadata.create_all(db)

    ub_upgrade()
    ub_init_template()
Beispiel #2
0
        sess.add(tmpl)
        sess.commit()
        sess.close()

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()

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)
Beispiel #3
0
        sess.close()


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()


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)
Beispiel #4
0
            sess.add(tmpl)
            sess.commit()
            sess.close()

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()

cfg = None
try:
    cfg = util.ub_get_blog_settings()
except KeyError,e:
    print >> sys.stdout,'Missing key %s in the settings list of UltraBlog.vim !' % str(e)
except:
    pass

try:
    api = xmlrpclib.ServerProxy(cfg.xmlrpc)
    db = sqlalchemy.create_engine("sqlite:///%s" % cfg.dbf)

    Session.configure(bind=db)
    Base.metadata.create_all(db)

    ub_upgrade()
    ub_init_template()
except: