# Path: peanut/site.py
# class Site(object):
#     def __init__(self, directory='.'):
#     def init(directory='./'):
#     def load_config(self, config_path):
#     def load_drafts(self):
#     def parse_draft(self, draft_file):
#     def push(self, url, username, password):
#     def generate(self):
# 
# Path: peanut/logger.py
# def init_logger(level):
#     logging.basicConfig(format='%(message)s', level=level)


import logging
import peanut
from docopt import docopt
from peanut import site
from peanut.logger import init_logger
  -d            Show Debug.
  -h --help     Show help.
  --version     Show version.
"""



def main():
    """Read command line arguments and generate site
    """
    args = docopt(__doc__, version='Peanut '+peanut.version)

    directory = args.get('<directory>', './') or './'
    config_path = args.get('<config_file_path>', None)

    visiable = args.get('-v', False)
    debug = args.get('-d', False)

    if debug:
        init_logger(logging.DEBUG)
    elif visiable:
        init_logger(logging.VISIABLE)
    else:
        init_logger(logging.INFO)

    if args['init']:
        logging.info('Init peanut environments')
        site.Site.init(directory)
        exit(0)


# Path: peanut/site.py
# class Site(object):
#     def __init__(self, directory='.'):
#     def init(directory='./'):
#     def load_config(self, config_path):
#     def load_drafts(self):
#     def parse_draft(self, draft_file):
#     def push(self, url, username, password):
#     def generate(self):
# 
# Path: peanut/logger.py
# def init_logger(level):
#     logging.basicConfig(format='%(message)s', level=level)


# Path: peanut/cmd.py
import logging
import peanut
from docopt import docopt
from peanut import site
from peanut.logger import init_logger

  -d            Show Debug.
  -h --help     Show help.
  --version     Show version.
"""



def main():
    """Read command line arguments and generate site
    """
    args = docopt(__doc__, version='Peanut '+peanut.version)

    directory = args.get('<directory>', './') or './'
    config_path = args.get('<config_file_path>', None)

    visiable = args.get('-v', False)
    debug = args.get('-d', False)

    if debug:
        init_logger(logging.DEBUG)
    elif visiable:
        init_logger(logging.VISIABLE)
    else:
        init_logger(logging.INFO)

    if args['init']:
        logging.info('Init peanut environments')
        site.Site.init(directory)
        exit(0)


    blog = site.Site(directory)