# Path: rophako/settings.py
# class ConfigHandler(object):
#     def load_settings(self):
#     def print_settings(self):
#     def load_plugins(self):
#     def __getattr__(self, section):
# 
# Path: rophako/log.py
# class LogHandler(logging.Handler):
#     def emit(self, record):


import bcrypt
import time
import rophako.jsondb as JsonDB
import rophako.model.photo as Photo
from rophako.settings import Config
from rophako.log import logger
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

"""User account models."""



def create(username, password, name=None, uid=None, role="user"):
    """Create a new user account.

    Returns the user ID number assigned to this user."""
    # Name defaults to username.
    if name is None:
        name = username

    username = username.lower()

    # Provided with a user ID?
    if uid is not None:
        # See if it's available.
        if exists(uid=uid):

# Path: rophako/settings.py
# class ConfigHandler(object):
#     def load_settings(self):
#     def print_settings(self):
#     def load_plugins(self):
#     def __getattr__(self, section):
# 
# Path: rophako/log.py
# class LogHandler(logging.Handler):
#     def emit(self, record):


# Path: rophako/model/user.py
import bcrypt
import time
import rophako.jsondb as JsonDB
import rophako.model.photo as Photo
from rophako.settings import Config
from rophako.log import logger

# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

"""User account models."""



def create(username, password, name=None, uid=None, role="user"):
    """Create a new user account.

    Returns the user ID number assigned to this user."""
    # Name defaults to username.
    if name is None:
        name = username

    username = username.lower()

    # Provided with a user ID?
    if uid is not None:
        # See if it's available.
        if exists(uid=uid):

            logger.warning("Wanted to use UID {} for user {} but it wasn't available.".format(uid, username))