[Pkg-isocodes-devel] [iso-codes] 01/01: Replace tabs with spaces
Tobias Quathamer
toddy at moszumanska.debian.org
Tue Feb 23 18:42:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
toddy pushed a commit to branch master
in repository iso-codes.
commit e450476c14bfd2d11965a040310244c94870122e
Author: Dr. Tobias Quathamer <toddy at debian.org>
Date: Tue Feb 23 19:42:39 2016 +0100
Replace tabs with spaces
---
check_valid_utf8.py | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/check_valid_utf8.py b/check_valid_utf8.py
index 3f37853..5cb152e 100755
--- a/check_valid_utf8.py
+++ b/check_valid_utf8.py
@@ -30,27 +30,27 @@ exit_status = 0
# Cycle through all files and check for valid UTF-8 encoding
for filename in sys.argv:
- # Open the file for reading in binary mode
- with open(filename, "rb") as pofile:
- # The "Content-Type" header has not been seen yet
- charset_utf8_seen = False
- # Read all lines to check for Content-Type header
- for line in pofile:
- # Try to decode binary data to UTF-8
- try:
- utf8 = line.decode(encoding="utf-8", errors="strict")
- except UnicodeError as error:
- print("UTF-8 encoding error in file %s: %s (position %d)" % (filename, error.reason, error.start))
- print("Binary data: %s" % line)
- exit_status = 1
- break
- if re.search(r'Content-Type: text/plain; charset=UTF-8', utf8):
- charset_utf8_seen = True
- # The whole file has been read, the content time should have
- # been detected now. Otherwise, it's an error.
- if not charset_utf8_seen:
- print("Error in file %s: could not detect Content-Type header" % filename)
- exit_status = 1
- break
+ # Open the file for reading in binary mode
+ with open(filename, "rb") as pofile:
+ # The "Content-Type" header has not been seen yet
+ charset_utf8_seen = False
+ # Read all lines to check for Content-Type header
+ for line in pofile:
+ # Try to decode binary data to UTF-8
+ try:
+ utf8 = line.decode(encoding="utf-8", errors="strict")
+ except UnicodeError as error:
+ print("UTF-8 encoding error in file %s: %s (position %d)" % (filename, error.reason, error.start))
+ print("Binary data: %s" % line)
+ exit_status = 1
+ break
+ if re.search(r'Content-Type: text/plain; charset=UTF-8', utf8):
+ charset_utf8_seen = True
+ # The whole file has been read, the content time should have
+ # been detected now. Otherwise, it's an error.
+ if not charset_utf8_seen:
+ print("Error in file %s: could not detect Content-Type header" % filename)
+ exit_status = 1
+ break
sys.exit(exit_status)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-isocodes/iso-codes.git
More information about the Pkg-isocodes-devel
mailing list