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

#
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

import os

class BuildState ():

    def __init__ (self, project_state, env, builddir, outdir):

        self.project_state = project_state

        cwd_saved = os.getcwd()

        os.chdir(project_state.project_directory)

        self.builddir = os.path.realpath(builddir)
        self.outdir = os.path.realpath(outdir)

        os.chdir(cwd_saved)

    def __repr__ (self):

        ps_repr = self.project_state.__repr__()

        return type(self).__name__ + "(" + ps_repr + ", '" \
            + self.builddir + "', '" + self.outdir + "')"<commit_msg>Actually store the environment that was passed to BuildState. Include the representation of it in the representation of BuildState.<commit_after>#!/usr/bin/env python3

#
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

import os

class BuildState ():

    def __init__ (self, project_state, env, builddir, outdir):

        self.project_state = project_state
        self.env = env

        cwd_saved = os.getcwd()

        os.chdir(project_state.project_directory)

        self.builddir = os.path.realpath(builddir)
        self.outdir = os.path.realpath(outdir)

        os.chdir(cwd_saved)

    def __repr__ (self):

        ps_repr = self.project_state.__repr__()
        env_repr = self.env.__repr__()

        return type(self).__name__ + "(" + ps_repr + ", " \
            + env_repr + ", '" + self.builddir + "', '" + self.outdir + "')"
{'fraction_non_alphanumeric': 0.08704592186429061, 'fraction_numerical': 0.003427004797806717, 'mean_word_length': 3.442922374429224, 'pattern_counts': {'":': 0, '<': 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': '6934712', 'n_tokens_mistral': 898, 'n_tokens_neox': 825, 'n_words': 321}