# 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):


from flask import g
from rophako.settings import Config
from rophako.log import logger
import time
import re
import glob
import os
import sys
import rophako.jsondb as JsonDB
    Args:
        drafts (bool): Whether to allow draft IDs to be resolved (for
            logged-in users only).
    """
    index = get_index(drafts=drafts)

    # If the ID is all numeric, it's the blog post ID directly.
    if re.match(r'^\d+$', fid):
        if fid in index:
            return int(fid)
        else:
            logger.error("Tried resolving blog post ID {} as an EntryID, but it wasn't there!".format(fid))
            return None

    # It's a friendly ID. Scan for it.
    for post_id, data in index.items():
        if data["fid"] == fid:
            return int(post_id)

    logger.error("Friendly post ID {} wasn't found!".format(fid))
    return None


def list_avatars():
    """Get a list of all the available blog avatars."""
    avatars = set()
    paths = [
        # Load avatars from both locations. We check the built-in set first,
        # so if you have matching names in your local site those will override.
        "rophako/www/static/avatars/*.*",

# 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/blog.py
from flask import g
from rophako.settings import Config
from rophako.log import logger
import time
import re
import glob
import os
import sys
import rophako.jsondb as JsonDB

    Args:
        drafts (bool): Whether to allow draft IDs to be resolved (for
            logged-in users only).
    """
    index = get_index(drafts=drafts)

    # If the ID is all numeric, it's the blog post ID directly.
    if re.match(r'^\d+$', fid):
        if fid in index:
            return int(fid)
        else:
            logger.error("Tried resolving blog post ID {} as an EntryID, but it wasn't there!".format(fid))
            return None

    # It's a friendly ID. Scan for it.
    for post_id, data in index.items():
        if data["fid"] == fid:
            return int(post_id)

    logger.error("Friendly post ID {} wasn't found!".format(fid))
    return None


def list_avatars():
    """Get a list of all the available blog avatars."""
    avatars = set()
    paths = [
        # Load avatars from both locations. We check the built-in set first,
        # so if you have matching names in your local site those will override.
        "rophako/www/static/avatars/*.*",

        os.path.join(Config.site.site_root, "static", "avatars", "*.*"),