# Path: config.py
# def sitename_from_readme():
#     """
#     Return text after hash on first non-blank line, if found, otherwise None.
#     """
#     with open('README.md') as f:
#         for line in f:
#             if not line.strip():
#                 continue
#             m = re.match('#(.*)$', line)
#             return m.group(1).strip() if m else None


import sqlalchemy as sqla
import argparse
import code
from sqlalchemy import inspect
from models import *
from library import *
from config import sitename_from_readme


app.app_context().push()

context = locals()

parser = argparse.ArgumentParser(description='Interactive shell preloaded with interesting objects of the app.')
args = parser.parse_args()


appname = sitename_from_readme()
if appname is None:
    appname = 'App'


# Path: config.py
# def sitename_from_readme():
#     """
#     Return text after hash on first non-blank line, if found, otherwise None.
#     """
#     with open('README.md') as f:
#         for line in f:
#             if not line.strip():
#                 continue
#             m = re.match('#(.*)$', line)
#             return m.group(1).strip() if m else None


# Path: shell.py
import sqlalchemy as sqla
import argparse
import code
from sqlalchemy import inspect
from models import *
from library import *
from config import sitename_from_readme



app.app_context().push()

context = locals()

parser = argparse.ArgumentParser(description='Interactive shell preloaded with interesting objects of the app.')
args = parser.parse_args()


appname = sitename_from_readme()
if appname is None:
    appname = 'App'


code.interact(local=context, banner='%s interactive shell.' % appname)