uitest/mass-testing/run.py |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a057dfd38d8309e15499370f5a23eb9a6a824da8
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu May 26 11:32:13 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu May 26 11:32:13 2022 +0200

    mass-testing: use magic to ignore csv files
    
    Change-Id: I4c3b85acc7b7dbbb1fe11c70ab6d564dd799cb2b

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 7bf4967..69cf3cb 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -17,6 +17,7 @@ from shutil import copyfile
 import time
 import fcntl
 import tempfile
+import magic
 import multiprocessing
 from multiprocessing_logging import install_mp_handler
 
@@ -74,7 +75,13 @@ def get_file_names(filesPath):
         for key, val in extensions.items():
             extension = os.path.splitext(fileName)[1][1:]
             if extension in val:
-                auxNames.append("file:///" + filesPath + fileName)
+                fullName = filesPath + fileName
+                mimetype = magic.from_file(fullName, mime=True)
+
+                # Ignore CSV files since they prompt the CSV import dialog
+                if mimetype == "application/csv":
+                    continue
+                auxNames.append("file:///" + fullName)
 
                 #Remove previous lock files
                 lockFilePath = filesPath + '.~lock.' + fileName + '#'

Reply via email to