# Path: turbulenz_local/lib/tools.py
# def create_id():
#     #id needs to be of 12-bytes length
#     string_id = ''
#     for _ in range(12):
#         string_id += '%02x' % randint(0, 255)
#     return string_id


from getpass import getuser as _get_user_name
from re import compile as re_compile, sub as re_sub
from pylons import config
from turbulenz_local.lib.tools import create_id
# Copyright (c) 2010-2014 Turbulenz Limited


# pylint: disable=F0401
# pylint: enable=F0401



class User(object):

    username_regex_pattern = '^[A-Za-z0-9]+[A-Za-z0-9-]*$'
    username_pattern = re_compile(username_regex_pattern)

    # remove any characters that do not match the regex
    try:
        default_username = re_sub('[^A-Za-z0-9-]', '', str(_get_user_name()))

# Path: turbulenz_local/lib/tools.py
# def create_id():
#     #id needs to be of 12-bytes length
#     string_id = ''
#     for _ in range(12):
#         string_id += '%02x' % randint(0, 255)
#     return string_id


# Path: turbulenz_local/models/user.py
from getpass import getuser as _get_user_name
from re import compile as re_compile, sub as re_sub
from pylons import config
from turbulenz_local.lib.tools import create_id

# Copyright (c) 2010-2014 Turbulenz Limited


# pylint: disable=F0401
# pylint: enable=F0401



class User(object):

    username_regex_pattern = '^[A-Za-z0-9]+[A-Za-z0-9-]*$'
    username_pattern = re_compile(username_regex_pattern)

    # remove any characters that do not match the regex
    try:
        default_username = re_sub('[^A-Za-z0-9-]', '', str(_get_user_name()))

        if len(default_username) == 0 or default_username[0] == '-':