Пример #1
0
    def extract_job_counts_from_xml(self, files, out_file = None):

        if out_file == None:
            my_xml.fix_xml_encoding(self.out_file, files)

            return ds.DashboardSupport().pull_job_data_from_xml(self.out_file + files)
        else:
            my_xml.fix_xml_encoding(out_file, files)

            return ds.DashboardSupport().pull_job_data_from_xml(out_file + files)
Пример #2
0
    def pull_weekly_analysis_tool_data_to_dict(self, zip_file, medians=False):

        self.zip_file_open(zip_file)

        file_name = zip_file[zip_file.rfind("\\") + 1:].strip(".zip")

        for files in os.listdir(self.temp_out_files):
            if file_name in files and "_" in files:

                xml_parse.fix_xml_encoding(self.zip_path, files)

                if medians is True:
                    print "Pulling data from " + files + "..."
                    weekly_dictionary = self.pull_medians_data(files)
                else:
                    print "Pulling data from " + files + "..."
                    weekly_dictionary = self.pull_count_data(files)

                return weekly_dictionary
Пример #3
0
    def pull_monthly_analysis_tool_data_to_dict(self, zip_file):
        self.zip_file_open(zip_file)

        file_name = zip_file[zip_file.rfind("\\") + 1:].strip(".zip")
        monthly_dictionary = {}

        for files in os.listdir(self.temp_out_files):
            if file_name in files and "_" in files:
                if "Overall" not in file_name and "Overall" in files:
                    continue
                else:
                    print "Pulling data from " + files + "..."

                    xml_parse.fix_xml_encoding(self.zip_path, files)

                    temporary_dictionary = self.pull_monthly_count_data(files)
                    monthly_dictionary.update(temporary_dictionary)

        return monthly_dictionary
Пример #4
0
    def pull_weekly_analysis_tool_data_to_dict(self, zip_file, medians=False):

        self.zip_file_open(zip_file)

        file_name = zip_file[zip_file.rfind("\\") + 1:].strip(".zip")

        for files in os.listdir(self.temp_out_files):
            if file_name in files and "_" in files:

                xml_parse.fix_xml_encoding(self.zip_path, files)

                if medians is True:
                    print "Pulling data from " + files + "..."
                    weekly_dictionary = self.pull_medians_data(files)
                else:
                    print "Pulling data from " + files + "..."
                    weekly_dictionary = self.pull_count_data(files)

                return weekly_dictionary
Пример #5
0
    def pull_monthly_analysis_tool_data_to_dict(self, zip_file):
        self.zip_file_open(zip_file)

        file_name = zip_file[zip_file.rfind("\\") + 1:].strip(".zip")
        monthly_dictionary = {}

        for files in os.listdir(self.temp_out_files):
            if file_name in files and "_" in files:
                if "Overall" not in file_name and "Overall" in files:
                    continue
                else:
                    print "Pulling data from " + files + "..."

                    xml_parse.fix_xml_encoding(self.zip_path, files)

                    temporary_dictionary = self.pull_monthly_count_data(files)
                    monthly_dictionary.update(temporary_dictionary)

        return monthly_dictionary
Пример #6
0
    def gather_results(self):
        self.DTO = AlumniDTO()
        for xml_files in os.listdir(const.anon_out):
            if ".xml" in xml_files and 'Gina Alumni Analytics' in xml_files:
                my_xml.fix_xml_encoding(const.anon_out, xml_files)

            if 'Gina Alumni Analytics Query 1' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " % (xml_files))
                data_dict = extract.ExtractXMLData(const.anon_out + xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 01' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict, self.DTO.query_01)

            elif 'Gina Alumni Analytics Query Large' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " % (xml_files))
                data_dict = extract.ExtractXMLData(const.anon_out + xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 02' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict, self.DTO.query_02)

            elif 'Gina Alumni Analytics Query 2' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " % (xml_files))
                data_dict = extract.ExtractXMLData(const.anon_out + xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 03' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict, self.DTO.query_03)

            elif 'Gina Alumni Analytics Query 3' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " % (xml_files))
                data_dict = extract.ExtractXMLData(const.anon_out + xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 04' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict, self.DTO.query_04)

            elif 'Gina Alumni Analytics Query 4' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " % (xml_files))
                data_dict = extract.ExtractXMLData(const.anon_out + xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 05' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict, self.DTO.query_05)

            elif 'Gina Alumni Analytics Query 5' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " % (xml_files))
                data_dict = extract.ExtractXMLData(const.anon_out + xml_files).sample_def_alumni_analytics_handler()
                main_key = 'Gina %s Query 06' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict, self.DTO.query_06)
Пример #7
0
    def gather_results(self):
        self.DTO = AlumniDTO()
        for xml_files in os.listdir(const.anon_out):
            if ".xml" in xml_files and 'Gina Alumni Analytics' in xml_files:
                my_xml.fix_xml_encoding(const.anon_out, xml_files)

            if 'Gina Alumni Analytics Query 1' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 01' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_01)

            elif 'Gina Alumni Analytics Query Large' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 02' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_02)

            elif 'Gina Alumni Analytics Query 2' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 03' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_03)

            elif 'Gina Alumni Analytics Query 3' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 04' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_04)

            elif 'Gina Alumni Analytics Query 4' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).table_def_medians_list_handler()
                main_key = 'Gina %s Query 05' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_05)

            elif 'Gina Alumni Analytics Query 5' in xml_files and '.xml' in xml_files:
                self.update_string_progress.emit("Pulling from %s... " %
                                                 (xml_files))
                data_dict = extract.ExtractXMLData(
                    const.anon_out +
                    xml_files).sample_def_alumni_analytics_handler()
                main_key = 'Gina %s Query 06' % self.affiliate_id
                self.update_dictionaries(xml_files, main_key, data_dict,
                                         self.DTO.query_06)
Пример #8
0
anon_out = "\\\\filer02\\public\\Data_Analytics\\AnonReports\\TempOut\\"

class AlumniDTO:

    def __init__(self):
        self.query_01 = {}
        self.query_02 = {}
        self.query_03 = {}
        self.query_04 = {}
        self.query_05 = {}
        self.query_06 = {}

test = AlumniDTO()

for xml_files in os.listdir(anon_out):
    if ".xml" in xml_files and 'Gina Alumni Analytics Query 1' in xml_files:
        my_xml.fix_xml_encoding(anon_out, xml_files)


    if 'Gina Alumni Analytics Query 4' in xml_files and '.xml' in xml_files:
        data_dict = extract.ExtractXMLData(anon_out + xml_files).table_def_medians_list_handler()
        main_key = 'Gina %s Query 04' % 1234
        if main_key not in test.query_01.keys():
            test.query_01[main_key] = data_dict
        else:
            copy_dict = test.query_01[main_key]
            copy_dict.update(data_dict)
            test.query_01[main_key] = copy_dict

print test.query_01
Пример #9
0
    def extract_unconfirmed_profile_data(self, files):

        my_xml.fix_xml_encoding(self.out_file, files)

        return ds.DashboardSupport().pull_unconfirmed_data_from_xml(self.out_file + files)
Пример #10
0
    def extract_job_model_data(self, files):

        my_xml.fix_xml_encoding(self.out_file, files)

        return ds.DashboardSupport().pull_model_data_from_xml(self.out_file + files)
Пример #11
0
    def extract_current_iqr_data(self, files):

        my_xml.fix_xml_encoding(self.out_file, files)

        return ds.DashboardSupport().pull_iqr_data_from_xml(self.out_file + files)
Пример #12
0
anon_out = "\\\\filer02\\public\\Data_Analytics\\AnonReports\\TempOut\\"


class AlumniDTO:
    def __init__(self):
        self.query_01 = {}
        self.query_02 = {}
        self.query_03 = {}
        self.query_04 = {}
        self.query_05 = {}
        self.query_06 = {}


test = AlumniDTO()

for xml_files in os.listdir(anon_out):
    if ".xml" in xml_files and 'Gina Alumni Analytics Query 1' in xml_files:
        my_xml.fix_xml_encoding(anon_out, xml_files)

    if 'Gina Alumni Analytics Query 4' in xml_files and '.xml' in xml_files:
        data_dict = extract.ExtractXMLData(
            anon_out + xml_files).table_def_medians_list_handler()
        main_key = 'Gina %s Query 04' % 1234
        if main_key not in test.query_01.keys():
            test.query_01[main_key] = data_dict
        else:
            copy_dict = test.query_01[main_key]
            copy_dict.update(data_dict)
            test.query_01[main_key] = copy_dict

print test.query_01
Пример #13
0
    def extract_unconfirmed_profile_data(self, files):

        my_xml.fix_xml_encoding(self.out_file, files)

        return ds.DashboardSupport().pull_unconfirmed_data_from_xml(self.out_file + files)
Пример #14
0
    def extract_job_model_data(self, files):

        my_xml.fix_xml_encoding(self.out_file, files)

        return ds.DashboardSupport().pull_model_data_from_xml(self.out_file + files)
Пример #15
0
    def extract_current_iqr_data(self, files):

        my_xml.fix_xml_encoding(self.out_file, files)

        return ds.DashboardSupport().pull_iqr_data_from_xml(self.out_file + files)