def init_fypress(login='', email='', passwd=''): if not passwd or not email or not login: print '*** /!\ Usage: python manager.py --login=name [email protected] --passwd=yourpass' return False user = User.add(login, email, passwd) if user: user.status = 4 user.nicename = user.login User.query.update(user) print '*** Added user: '******'*** /!\ Invalid user (Duplicate entry)' exist = Folder.query.get(1) if not exist: folder = Folder() folder.name = 'Uncategorized' folder.created = 'NOW()' folder.modified = 'NOW()' folder.id = 1 folder.guid = '' Folder.query.add(folder) print '*** Added Folder: '+str(folder) options = [ ['name', 'FyPress Site'], ['url', Config.URL], ['slogan', 'Welcome to FyPress'], ['theme', 'Nyx'] ] for option in options: opt = Option.update(option[0], option[1]) print '*** Added Option: '+str(opt)
def init_fypress(login="", email="", passwd=""): if not passwd or not email or not login: print "*** /!\ Usage: python manager.py --login=name [email protected] --passwd=yourpass" return False user = User.add(login, email, passwd) if user: user.status = 4 user.nicename = user.login User.query.update(user) print "*** Added user: "******"*** /!\ Invalid user (Duplicate entry)" exist = Folder.query.get(1) if not exist: folder = Folder() folder.name = "Uncategorized" folder.created = "NOW()" folder.modified = "NOW()" folder.id = 1 folder.guid = "" Folder.query.add(folder) print "*** Added Folder: " + str(folder) options = [["name", "FyPress Site"], ["url", Config.URL], ["slogan", "Welcome to FyPress"], ["theme", "Nyx"]] for option in options: opt = Option.update(option[0], option[1]) print "*** Added Option: " + str(opt)
def before_request(): from fypress.user import User g.user = None if 'user_id' in session: g.user = User.query.get(session['user_id']) from fypress.admin import Option g.options = Option.auto_load()
def before_request(): global options if '/public/' not in request.path: from fypress.user import User g.user = None if 'user_id' in session: g.user = User.query.get(session['user_id']) if len(options) == 0: from fypress.admin import Option options = Option.auto_load() g.options = options
def preview(): fypress.options['theme'] = request.args.get('theme') render = root() fypress.options = Option.auto_load() return render
def before_request(): if not fypress.options: fypress.options = Option.auto_load()