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

from __future__ import print_function
from distutils.core import setup, Command
from glob import glob
import os

cmdclass = {}

scripts = glob(os.path.join('scripts', '*'))

class BuildQt(Command):

    user_options = [
    ('pyrcc4=', 'p', "Custom pyrcc4 command")
    ]

    def initialize_options(self):
        self.pyrcc4 = 'pyrcc4'

    def finalize_options(self):
        pass

    def run(self):

        import os
        import glob
        from PyQt4.uic import compileUi

        for infile in glob.glob(os.path.join('glue', 'qt', '*.ui')):
            print("Compiling " + infile)
            directory, filename = os.path.split(infile)
            outfile = os.path.join(directory, 'ui_' + filename.replace('.ui', '.py'))
            compileUi(infile, open(outfile, 'wb'))

        import sys
        import subprocess
        print("Compiling glue/qt/glue.qrc")
        if sys.version_info[0] == 2:
            option = '-py2'
        else:
            option = '-py3'
        try:
            subprocess.call([self.pyrcc4, option, 'glue/qt/glue.qrc', '-o', 'glue/qt/glue_qt_resources.py'])
        except OSError:
            print("pyrcc4 command failed - make sure that pyrcc4 "
                  "is in your $PATH, or specify a custom command with "
                  "--pyrcc4=command")


cmdclass['build_qt'] = BuildQt

try:  # Python 3.x
    from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:  # Python 2.x
    from distutils.command.build_py import build_py

cmdclass['build_py'] = build_py

setup(name='Glue',
      version='0.1.0',
      packages=['glue', 'glue.qt'],
      cmdclass=cmdclass,
      package_data={'glue': ['examples/*']},
      scripts=scripts
  )
<commit_msg>Updated setup.py file to build *.ui files in new location<commit_after>#!/usr/bin/env python

from __future__ import print_function
from distutils.core import setup, Command
from glob import glob
import os

cmdclass = {}

scripts = glob(os.path.join('scripts', '*'))

class BuildQt(Command):

    user_options = [
    ('pyrcc4=', 'p', "Custom pyrcc4 command")
    ]

    def initialize_options(self):
        self.pyrcc4 = 'pyrcc4'

    def finalize_options(self):
        pass

    def run(self):

        import os
        import glob
        from PyQt4.uic import compileUi

        for infile in glob.glob(os.path.join('glue', 'qt', 'ui', '*.ui')):
            print("Compiling " + infile)
            directory, filename = os.path.split(infile)
            outfile = os.path.join(directory, filename.replace('.ui', '.py'))
            compileUi(infile, open(outfile, 'wb'))

        import sys
        import subprocess
        print("Compiling glue/qt/glue.qrc")
        if sys.version_info[0] == 2:
            option = '-py2'
        else:
            option = '-py3'
        try:
            subprocess.call([self.pyrcc4, option, 'glue/qt/glue.qrc', '-o', 'glue/qt/glue_qt_resources.py'])
        except OSError:
            print("pyrcc4 command failed - make sure that pyrcc4 "
                  "is in your $PATH, or specify a custom command with "
                  "--pyrcc4=command")


cmdclass['build_qt'] = BuildQt

try:  # Python 3.x
    from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:  # Python 2.x
    from distutils.command.build_py import build_py

cmdclass['build_py'] = build_py

setup(name='Glue',
      version='0.1.0',
      packages=['glue', 'glue.qt'],
      cmdclass=cmdclass,
      package_data={'glue': ['examples/*']},
      scripts=scripts
  )

{'fraction_non_alphanumeric': 0.13015607580824973, 'fraction_numerical': 0.011148272017837236, 'mean_word_length': 2.4018957345971566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3556811', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1154, 'n_words': 275}