mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Add a script to check invalid screenshot(s).
This commit is contained in:
committed by
Benoit Marty
parent
4f8d3c17f0
commit
cc6aeb057e
@@ -3,6 +3,7 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from util import compare
|
||||
|
||||
# Read all arguments and return a list of them, this are the languages list.
|
||||
def readArguments():
|
||||
@@ -40,20 +41,6 @@ def detectLanguages():
|
||||
return languages
|
||||
|
||||
|
||||
def compare(file1, file2):
|
||||
__doc__ = "Compare two files, return True if different, False if identical."
|
||||
# Compare file size
|
||||
file1_stats = os.stat(file1)
|
||||
file2_stats = os.stat(file2)
|
||||
if file1_stats.st_size != file2_stats.st_size:
|
||||
return True
|
||||
# Compare file content
|
||||
with open(file1, "rb") as f1, open(file2, "rb") as f2:
|
||||
content1 = f1.read()
|
||||
content2 = f2.read()
|
||||
return content1 != content2
|
||||
|
||||
|
||||
def deleteDuplicatedScreenshots(lang):
|
||||
__doc__ = "Delete screenshots identical to the English version for a language"
|
||||
print("Deleting screenshots identical to the English version for language %s..." % lang)
|
||||
|
||||
Reference in New Issue
Block a user