Repository Public
1#!/usr/bin/env python32# =============================================================================3# SP BOUCHER | SOFTWARE & RESEARCH4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# PROJECT METADATA8# -----------------------------------------------------------------------------9# Project : Lou-Ka Admin iOS10# File : Scripts/captures.py11# Description : range les captures nommées d'un lot de tests d'interface12# (export xcresulttool) dans un dossier. usage : captures.py13# <dossier exporté> <dossier cible> [préfixe du nom]14# Module : Scripts15# Repository : https://git.spboucher.ai/lou-ka-admin-ios16# Project Website : https://www.lou-ka.com17# Created : 2026-11-3018# Last Modified : 2026-11-3019#20# =============================================================================21# AUTHOR & PROFESSIONAL AFFILIATION22# =============================================================================23#24# Author : Simon-Pierre Boucher25# Position : Professor of Finance26# Institution : Université du Québec en Outaouais (UQO)27# Department : Département des sciences administratives28# Organization : SP Boucher29#30# Website : https://spboucher.ai31# Git : https://git.spboucher.ai32#33# =============================================================================34# OFFICIAL CONTACT DIRECTORY35# =============================================================================36#37# General : info@spboucher.ai38# Professional : contact@spboucher.ai39# Direct : simon@spboucher.ai40# Research : research@spboucher.ai41# Development : dev@spboucher.ai42# Support : support@spboucher.ai43# Security/Admin : admin@spboucher.ai44# Notifications : notifications@spboucher.ai45#46# Preferred Contact: support@spboucher.ai47#48# =============================================================================49# COPYRIGHT & INTELLECTUAL PROPERTY50# =============================================================================51#52# Copyright (c) 202653# Simon-Pierre Boucher54#55# All rights reserved where applicable.56#57# This file is governed by the applicable project license,58# copyright notices, institutional agreements and relevant law.59#60# Unless expressly authorized by the applicable license or61# rights holder, copying, redistribution, sublicensing,62# publication and commercial exploitation are not permitted.63#64# Existing third-party rights and notices remain unaffected.65#66# =============================================================================67# CONFIDENTIALITY & SECURITY68# =============================================================================69#70# Classification : Public71# Distribution : Public repository; use is governed by the project license72# Security Contact : admin@spboucher.ai73#74# Access to this source does not independently grant permission75# to redistribute or disclose confidential materials.76#77# Do not embed credentials, private keys, access tokens,78# certificates or confidential personal information.79#80# =============================================================================81# LICENSE & MAINTENANCE82# =============================================================================83#84# License : None specified (no license file in this repository)85# Maintainer : Simon-Pierre Boucher86# Technical Contact: dev@spboucher.ai87#88# =============================================================================89# END OF SP BOUCHER SOURCE HEADER90# =============================================================================9192import json, os, re, shutil, sys9394src, dst = sys.argv[1], sys.argv[2]95prefix = sys.argv[3] if len(sys.argv) > 3 else ""96os.makedirs(dst, exist_ok=True)97n = 098for test in json.load(open(os.path.join(src, "manifest.json"))):99 for a in test.get("attachments", []):100 name = a.get("suggestedHumanReadableName", "")101 m = re.match(r"(.+?)_\d+_[0-9A-F-]{36}\.png$", name)102 if not m or not m.group(1).startswith(prefix):103 continue104 shutil.copy(os.path.join(src, a["exportedFileName"]), os.path.join(dst, m.group(1) + ".png"))105 n += 1106print(f"{n} captures -> {dst}")107