def _find_candidates(self, test_set): name_part = test_set.apk_name_part.replace(".apk", "") Printer.system_message( self.TAG, "Checking " + Color.GREEN + GlobalConfig.APK_DIR + Color.BLUE + " directory for .*apk" + " list with names containing " + Color.GREEN + name_part + Color.BLUE + ":") app_apk_list = self.get_list_with_application_apk( name_part, GlobalConfig.APK_DIR) test_apk_list = self.get_list_with_test_apk(name_part, GlobalConfig.APK_DIR) path = 0 name = 1 if app_apk_list: for apk in app_apk_list: apk_filename = apk[name] apk_filepath = FileUtils.clean_folder_only_dir( FileUtils.add_ending_slash(apk[path])) + apk[name] apk_test_filename = "" apk_test_filepath = "" for test_apk in test_apk_list: if apk_filename.replace( ".apk", "" ) in test_apk[name] and "-androidTest" in test_apk[name]: apk_test_filename = test_apk[name] apk_test_filepath = FileUtils.clean_folder_only_dir( FileUtils.add_ending_slash( test_apk[path])) + test_apk[name] dump = self.aapt_controller.dump_badging(apk_filepath) version_code = re.findall("versionCode='(.+?)'", dump) version_code = int(version_code[0]) self.apk_candidates.append( ApkCandidate(apk_filename, apk_filepath, apk_test_filename, apk_test_filepath, version_code)) else: Printer.system_message(self.TAG, " * No .apk* files found.")
def _copy_styles(): generator_styles_dir = FileUtils.clean_folder_only_dir( GlobalConfig.LOG_GENERATOR_DIR + GENERATOR_STYLES_DIR) FileUtils.copy(generator_styles_dir, GlobalConfig.OUTPUT_STYLES_FOLDER_DIR)