# Path: packages/database.py
# def init_db():
# 
# Path: packages/objects.py
# class User(Base):
#     __tablename__ = 'user'
#     id = Column(Integer, primary_key = True)
#     username = Column(String(128), nullable = False, index = True)
#     email = Column(String(256), nullable = False, index = True)
#     admin = Column(Boolean())
#     password = Column(String)
#     created = Column(DateTime)
#     confirmation = Column(String(128))
#     passwordReset = Column(String(128))
#     passwordResetExpiry = Column(DateTime)
#     packages = relationship('Package', order_by='Package.created')
# 
#     def set_password(self, password):
#         self.password = bcrypt.hashpw(password, bcrypt.gensalt())
# 
#     def __init__(self, username, email, password):
#         self.email = email
#         self.username = username
#         self.password = bcrypt.hashpw(password, bcrypt.gensalt())
#         self.admin = False
#         self.created = datetime.now()
# 
#     def __repr__(self):
#         return '<User %r>' % self.username
# 
#     # Flask.Login stuff
#     # We don't use most of these features
#     def is_authenticated(self):
#         return True
#     def is_active(self):
#         return True
#     def is_anonymous(self):
#         return False
#     def get_id(self):
#         return self.username
# 
# Path: packages/config.py



import smtplib
import pystache
import os
import html.parser
from email.mime.text import MIMEText
from werkzeug.utils import secure_filename
from flask import url_for
from packages.database import db
from packages.objects import User
from packages.config import _cfg, _cfgi


def send_confirmation(user):
    if _cfg("smtp-host") == "":
        return

# Path: packages/database.py
# def init_db():
# 
# Path: packages/objects.py
# class User(Base):
#     __tablename__ = 'user'
#     id = Column(Integer, primary_key = True)
#     username = Column(String(128), nullable = False, index = True)
#     email = Column(String(256), nullable = False, index = True)
#     admin = Column(Boolean())
#     password = Column(String)
#     created = Column(DateTime)
#     confirmation = Column(String(128))
#     passwordReset = Column(String(128))
#     passwordResetExpiry = Column(DateTime)
#     packages = relationship('Package', order_by='Package.created')
# 
#     def set_password(self, password):
#         self.password = bcrypt.hashpw(password, bcrypt.gensalt())
# 
#     def __init__(self, username, email, password):
#         self.email = email
#         self.username = username
#         self.password = bcrypt.hashpw(password, bcrypt.gensalt())
#         self.admin = False
#         self.created = datetime.now()
# 
#     def __repr__(self):
#         return '<User %r>' % self.username
# 
#     # Flask.Login stuff
#     # We don't use most of these features
#     def is_authenticated(self):
#         return True
#     def is_active(self):
#         return True
#     def is_anonymous(self):
#         return False
#     def get_id(self):
#         return self.username
# 
# Path: packages/config.py



# Path: packages/email.py
import smtplib
import pystache
import os
import html.parser
from email.mime.text import MIMEText
from werkzeug.utils import secure_filename
from flask import url_for
from packages.database import db
from packages.objects import User
from packages.config import _cfg, _cfgi



def send_confirmation(user):
    if _cfg("smtp-host") == "":
        return

    smtp = smtplib.SMTP(_cfg("smtp-host"), _cfgi("smtp-port"))