# Path: publicstatic/conf.py
# class NotFoundException(errors.BasicException):
# class ParsingError(errors.BasicException):
# class ConfigurationExistsException(errors.BasicException):
# class NotInitializedException(errors.BasicException):
# def path():
# def defaults():
# def load(conf_path):
# def generate(conf_path, force):
# def find_conf(conf_path):
# def get(param, default=None):
# def set(param, value):
# def tags_rel_url():
# def commons():
# def _dumpopt(opt_name):
# def _purify(params):
# def _expand(rel_path):
# def _trsl(url):


import codecs
import os
import re
import shutil
import sys
import time
from datetime import datetime
from publicstatic import conf
from publicstatic.urlify import urlify
    from webbrowser import open_new_tab
# coding: utf-8

"""General purpose helper functions"""


RE_H1 = re.compile(r"^\s*#\s*(.*)\s*", re.I | re.M | re.U)


def makedirs(dir_path):
    """Creates directory if it not exists."""
    if dir_path and not os.path.isdir(dir_path):
        os.makedirs(dir_path)
        return True
    return False


def browse(url, delay):
    """Opens specified @url with system default browser
    after @delay seconds."""
    time.sleep(delay)
    open_new_tab(url)


def parse_time(value, default=None):
    """Converts string to datetime using the first of the preconfigured
    time_format values that will work."""
    if not value and default:
        return default

# Path: publicstatic/conf.py
# class NotFoundException(errors.BasicException):
# class ParsingError(errors.BasicException):
# class ConfigurationExistsException(errors.BasicException):
# class NotInitializedException(errors.BasicException):
# def path():
# def defaults():
# def load(conf_path):
# def generate(conf_path, force):
# def find_conf(conf_path):
# def get(param, default=None):
# def set(param, value):
# def tags_rel_url():
# def commons():
# def _dumpopt(opt_name):
# def _purify(params):
# def _expand(rel_path):
# def _trsl(url):


# Path: publicstatic/helpers.py
import codecs
import os
import re
import shutil
import sys
import time
from datetime import datetime
from publicstatic import conf
from publicstatic.urlify import urlify
    from webbrowser import open_new_tab

# coding: utf-8

"""General purpose helper functions"""


RE_H1 = re.compile(r"^\s*#\s*(.*)\s*", re.I | re.M | re.U)


def makedirs(dir_path):
    """Creates directory if it not exists."""
    if dir_path and not os.path.isdir(dir_path):
        os.makedirs(dir_path)
        return True
    return False


def browse(url, delay):
    """Opens specified @url with system default browser
    after @delay seconds."""
    time.sleep(delay)
    open_new_tab(url)


def parse_time(value, default=None):
    """Converts string to datetime using the first of the preconfigured
    time_format values that will work."""
    if not value and default:
        return default

    for time_format in conf.get('time_format'):