# Path: sam/constants.py
# LDAP = {
#     'connection_string': config.get('LDAP', 'connection_string', default='')
# }
# def enable_local_mode():
# def init_urls():
# def find_url(target):
# def get_navbar(lang):


import os
import re
import base
import sam.models.settings
import sam.models.datasources
import sam.models.livekeys
import sam.models.nodes
import pprint
from sam import constants
from sam import common


def nice_name(s):
    s = re.sub("([a-z])([A-Z]+)", lambda x: "{0} {1}".format(x.group(1), x.group(2)), s)
    s = s.replace("_", " ")
    s = re.sub("\s+", ' ', s)
    return s.title()


class SettingsPage(base.headed):
    def __init__(self):
        super(SettingsPage, self).__init__(True, True)
        self.set_title(self.page.strings.settings_title)
        self.styles = ["/static/css/general.css"]
        self.scripts = ["/static/js/settings.js"]
        self.settingsModel = None
        self.dsModel = None
        self.livekeyModel = None
        self.nodes_model = None

    @staticmethod
    def get_available_importers():

# Path: sam/constants.py
# LDAP = {
#     'connection_string': config.get('LDAP', 'connection_string', default='')
# }
# def enable_local_mode():
# def init_urls():
# def find_url(target):
# def get_navbar(lang):


# Path: sam/pages/settings_page.py
import os
import re
import base
import sam.models.settings
import sam.models.datasources
import sam.models.livekeys
import sam.models.nodes
import pprint
from sam import constants
from sam import common



def nice_name(s):
    s = re.sub("([a-z])([A-Z]+)", lambda x: "{0} {1}".format(x.group(1), x.group(2)), s)
    s = s.replace("_", " ")
    s = re.sub("\s+", ' ', s)
    return s.title()


class SettingsPage(base.headed):
    def __init__(self):
        super(SettingsPage, self).__init__(True, True)
        self.set_title(self.page.strings.settings_title)
        self.styles = ["/static/css/general.css"]
        self.scripts = ["/static/js/settings.js"]
        self.settingsModel = None
        self.dsModel = None
        self.livekeyModel = None
        self.nodes_model = None

    @staticmethod
    def get_available_importers():

        files = os.listdir(os.path.join(constants.base_path, "importers"))