<commit_before>#!/usr/bin/env python

'''
Created on Apr 29, 2012
'''

from __future__ import division

__author__ = "<NAME>"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "Apr 29, 2012"

import os
import subprocess
import glob
import shlex
import shutil

sphinxcmd = "sphinx-apidoc -o . -f ../pymatgen"
args = shlex.split(sphinxcmd)
p = subprocess.Popen(args)
output = p.communicate()[0]

for f in glob.glob("*.rst"):
    if f.endswith('tests.rst'):
        os.remove(f)
    elif f.startswith('pymatgen') and f.endswith('rst'):
        newoutput = []
        suboutput = []
        subpackage = False
        with open(f, 'r') as fid:
            for line in fid:
                if line.strip() == "Subpackages":
                    subpackage = True
                if not subpackage:
                    newoutput.append(line)
                else:
                    suboutput.append(line)
                    if line.strip().startswith("pymatgen") and not line.strip().endswith("tests"):
                        newoutput.extend(suboutput)
                        subpackage = False
                        suboutput = []

        with open(f, 'w') as fid:
            fid.write("".join(newoutput))

p = subprocess.Popen(["make", "html"])
output = p.communicate()[0]

shutil.copyfile("nature_mp.css", os.path.join("..", "..", "docs", "pymatgen", "html", "static", "nature.css"))
shutil.copyfile("favicon.ico", os.path.join("..", "..", "docs", "pymatgen", "html", "static", "favicon.ico"))

#cp favicon.ico .. / .. / docs / pymatgen / html / static / favicon.ico
#cp pymatgen.png .. / .. / docs / pymatgen / html / static / pymatgen.png
<commit_msg>More fixes to doc update.<commit_after>#!/usr/bin/env python

'''
Created on Apr 29, 2012
'''

from __future__ import division

__author__ = "<NAME>"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "Apr 29, 2012"

import os
import subprocess
import glob
import shlex
import shutil

sphinxcmd = "sphinx-apidoc -o . -f ../pymatgen"
args = shlex.split(sphinxcmd)
p = subprocess.Popen(args)
output = p.communicate()[0]

for f in glob.glob("*.rst"):
    if f.endswith('tests.rst'):
        os.remove(f)
    elif f.startswith('pymatgen') and f.endswith('rst'):
        newoutput = []
        suboutput = []
        subpackage = False
        with open(f, 'r') as fid:
            for line in fid:
                if line.strip() == "Subpackages":
                    subpackage = True
                if not subpackage:
                    newoutput.append(line)
                else:
                    suboutput.append(line)
                    if line.strip().startswith("pymatgen") and not line.strip().endswith("tests"):
                        newoutput.extend(suboutput)
                        subpackage = False
                        suboutput = []

        with open(f, 'w') as fid:
            fid.write("".join(newoutput))

p = subprocess.Popen(["make", "html"])
output = p.communicate()[0]

shutil.copyfile("nature_mp.css", os.path.join("..", "..", "docs", "pymatgen", "html", "static", "nature.css"))
shutil.copyfile("favicon.ico", os.path.join("..", "..", "docs", "pymatgen", "html", "static", "favicon.ico"))
shutil.copyfile("pymatgen.png", os.path.join("..", "..", "docs", "pymatgen", "html", "static", "pymatgen.png"))

{'fraction_non_alphanumeric': 0.1642135642135642, 'fraction_numerical': 0.011544011544011544, 'mean_word_length': 2.300952380952381, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1596378', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1119, 'n_words': 263}