# Path: runserver.py
# DEFAULT_HOST = 'http://static.localhost:8001'
# DEFAULT_KEY = ''
# def shell_command():
# def runserver():
# def init():
#     def random_sep(n=6):
#     def random_word(n=20, sep=True):
# def clear_cache():
# def initdb():
# def babel_init(lang):
# def babel_update():
# def babel_compile():
# def create_user(username, email, password):
# def password(username, password):
# def token(username):
# def upload(host, bucket, path, key, files, force):
#     def list_files(upath):
# def upload_shell(host, bucket, path, key):
# def list_routers():
# 
# Path: maple/model.py
# class User(db.Model, UserMixin):
# class Group(db.Model, GroupMixin):
# class Permission(db.Model, PermissionMixin):
#     def is_admin(self):
#     def token(self):
#     def check_token(cls, token, max_age=24 * 3600 * 30):


import os
from datetime import datetime
from re import compile
from runserver import app
from maple.model import Blog, Category, Tag, User
    _category = attr['category']
    _tags = attr['tags'].split(',')
    _title = attr['title']
    _date = attr['date']
    _content = attr['content']

    user = User.query.filter_by(username=_author).first()
    if not user:
        user = User(username=_author, email='mail@honmaple.com')
        user.set_password('123123')
        user.save()

    category = Category.query.filter_by(name=_category).first()
    if not category:
        category = Category(name=_category)
        category.save()

    tags = []
    for _tag in _tags:
        tag = Tag.query.filter_by(name=_tag).first()
        if not tag:
            tag = Tag(name=_tag)
            tag.save()
        tags.append(tag)

    try:
        _date = datetime.strptime(_date, '%Y-%m-%d'),
    except ValueError:
        _date = datetime.strptime(_date, '%Y-%m-%d %H:%M:%S'),


# Path: runserver.py
# DEFAULT_HOST = 'http://static.localhost:8001'
# DEFAULT_KEY = ''
# def shell_command():
# def runserver():
# def init():
#     def random_sep(n=6):
#     def random_word(n=20, sep=True):
# def clear_cache():
# def initdb():
# def babel_init(lang):
# def babel_update():
# def babel_compile():
# def create_user(username, email, password):
# def password(username, password):
# def token(username):
# def upload(host, bucket, path, key, files, force):
#     def list_files(upath):
# def upload_shell(host, bucket, path, key):
# def list_routers():
# 
# Path: maple/model.py
# class User(db.Model, UserMixin):
# class Group(db.Model, GroupMixin):
# class Permission(db.Model, PermissionMixin):
#     def is_admin(self):
#     def token(self):
#     def check_token(cls, token, max_age=24 * 3600 * 30):


# Path: script/convert.py
import os
from datetime import datetime
from re import compile
from runserver import app
from maple.model import Blog, Category, Tag, User

    _category = attr['category']
    _tags = attr['tags'].split(',')
    _title = attr['title']
    _date = attr['date']
    _content = attr['content']

    user = User.query.filter_by(username=_author).first()
    if not user:
        user = User(username=_author, email='mail@honmaple.com')
        user.set_password('123123')
        user.save()

    category = Category.query.filter_by(name=_category).first()
    if not category:
        category = Category(name=_category)
        category.save()

    tags = []
    for _tag in _tags:
        tag = Tag.query.filter_by(name=_tag).first()
        if not tag:
            tag = Tag(name=_tag)
            tag.save()
        tags.append(tag)

    try:
        _date = datetime.strptime(_date, '%Y-%m-%d'),
    except ValueError:
        _date = datetime.strptime(_date, '%Y-%m-%d %H:%M:%S'),


    blog = Blog.query.filter_by(title=_title).first()