Add a script to check invalid screenshot(s).
This commit is contained in:
parent
ca7dcee7b2
commit
1b3bf575b1
5 changed files with 90 additions and 14 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue