<commit_before>"""
quilt.QuiltingRoom

Main module to quilt a static site by stitching html page together
{: .lead}

1. set `source` to users directory containing the [appropriate files](#exampledir) (default output is `quilted_` + `source`)
2. read `config.json` and override [default configuration](#configuration)
3. load quilt file at `quilt.html`
4. load all patch files in `patches/`
5. locate `pages/`, `templates/`, and `assets/` directories
6. if `posts/` exists and configured to build a blog create [`Blog` object]{#Blog}
7. build assets by (+ = optional):
    1. copy `assets/` to output
    2. creating `favicon.ico` +
    3. combine all `css` files into one +
        * auto add vendor prefix +
        * minimize each file +
    4. combine all `js` files into one +
        * minimize each file +
8. go thru pages and stitch together with [`Quilter` object]{#Quilter}
    * if post append page data to `Blog` object
9. add blog Home, Tag and Category pages
10. generate `atom` feed and/or `rss` feed
11. fill directories without `index.html`
12. add `robot.txt`
13. generate `search.json`, a word to url index for `typeahead`
14. generate `sitemap.xml`

project    : quilt
version    : 0.1.1
status     : development
modifydate : 2015-05-13 07:09:00 -0700
createdate : 2015-04-28 06:02:00 -0700
website    : https://github.com/tmthydvnprt/quilt
author     : tmthydvnprt
email      : <EMAIL>
maintainer : tmthydvnprt
license    : MIT
copyright  : Copyright 2015, quilt
credits    :

"""

import os
import bs4
import json
import copy
import glob
import time
import shutil
import fnmatch
import datetime
import PIL.Image
import subprocess

import quilt
from quilt.Blog import Blog
from quilt.Quilter import Quilter
from quilt.Util import DEFAULT_CONFIG, read_file, write_file, load_files, get_file_names
from quilt.Util import find_hrefsrc, filter_external_url, minimize_css, minimize_js, prefix_vendor_css
from quilt.Util import path_link_list, top_sentences, get_just_words, get_keywords, spell_check, analyze_post, ProgressBar
from quilt.Util import reverse_chronological_order, check_local_quilt, get_group, make_group_links
from quilt.Util import  HEAD_STRAINER, BODY_STRAINER
from quilt.Constants import QUILTHEADER, ASSETCOMMENT, ROBOTTXT, SITEMAPINDEX, SITEMAP, SITEMAPURL
from quilt.Constants import NO_NEW_POSTS, NO_OLD_POSTS, CSS_EXT_RE, ROOT_LEVEL_JS_EXT_RE

class QuiltingRoom(object):
    """the quilting room"""

    #@profile
    def __init__(self, source='', output=''):
        """setup the quilting room"""

        # default configuration
        self.config = copy.copy(DEFAULT_CONFIG)

        # set runtime variables
        self.source = source
        self.output = output or os.path.dirname(self.source) + '/quilted_' + os.path.basename(self.source)

        # runtime<commit_msg>forgot to import new function<commit_after>"""
quilt.QuiltingRoom

Main module to quilt a static site by stitching html page together
{: .lead}

1. set `source` to users directory containing the [appropriate files](#exampledir) (default output is `quilted_` + `source`)
2. read `config.json` and override [default configuration](#configuration)
3. load quilt file at `quilt.html`
4. load all patch files in `patches/`
5. locate `pages/`, `templates/`, and `assets/` directories
6. if `posts/` exists and configured to build a blog create [`Blog` object]{#Blog}
7. build assets by (+ = optional):
    1. copy `assets/` to output
    2. creating `favicon.ico` +
    3. combine all `css` files into one +
        * auto add vendor prefix +
        * minimize each file +
    4. combine all `js` files into one +
        * minimize each file +
8. go thru pages and stitch together with [`Quilter` object]{#Quilter}
    * if post append page data to `Blog` object
9. add blog Home, Tag and Category pages
10. generate `atom` feed and/or `rss` feed
11. fill directories without `index.html`
12. add `robot.txt`
13. generate `search.json`, a word to url index for `typeahead`
14. generate `sitemap.xml`

project    : quilt
version    : 0.1.1
status     : development
modifydate : 2015-05-13 07:09:00 -0700
createdate : 2015-04-28 06:02:00 -0700
website    : https://github.com/tmthydvnprt/quilt
author     : tmthydvnprt
email      : <EMAIL>
maintainer : tmthydvnprt
license    : MIT
copyright  : Copyright 2015, quilt
credits    :

"""

import os
import bs4
import json
import copy
import glob
import time
import shutil
import fnmatch
import datetime
import PIL.Image
import subprocess

import quilt
from quilt.Blog import Blog
from quilt.Quilter import Quilter
from quilt.Util import DEFAULT_CONFIG, time_since, read_file, write_file, load_files, get_file_names
from quilt.Util import find_hrefsrc, filter_external_url, minimize_css, minimize_js, prefix_vendor_css
from quilt.Util import path_link_list, top_sentences, get_just_words, get_keywords, spell_check, analyze_post, ProgressBar
from quilt.Util import reverse_chronological_order, check_local_quilt, get_group, make_group_links
from quilt.Util import  HEAD_STRAINER, BODY_STRAINER
from quilt.Constants import QUILTHEADER, ASSETCOMMENT, ROBOTTXT, SITEMAPINDEX, SITEMAP, SITEMAPURL
from quilt.Constants import NO_NEW_POSTS, NO_OLD_POSTS, CSS_EXT_RE, ROOT_LEVEL_JS_EXT_RE

class QuiltingRoom(object):
    """the quilting room"""

    #@profile
    def __init__(self, source='', output=''):
        """setup the quilting room"""

        # default configuration
        self.config = copy.copy(DEFAULT_CONFIG)

        # set runtime variables
        self.source = source
        self.output = output or os.path.dirname(self.source) + '/quilted_' + os.path.basename(self.source)

        # runtime
{'fraction_non_alphanumeric': 0.09198446327683615, 'fraction_numerical': 0.02365819209039548, 'mean_word_length': 4.022163120567376, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3586298', 'n_tokens_mistral': 1908, 'n_tokens_neox': 1757, 'n_words': 616}