[Python-checkins] python/dist/src/Tools/scripts findnocoding.py, 1.1, 1.2 pysource.py, 1.1, 1.2
tim_one@users.sourceforge.net
tim_one at users.sourceforge.net
Fri Aug 26 17:20:58 CEST 2005
- Previous message: [Python-checkins] python/dist/src/Lib/test seq_tests.py, 1.5, 1.6 test_generators.py, 1.47, 1.48 test_hashlib_speed.py, 1.1, 1.2 test_mmap.py, 1.33, 1.34
- Next message: [Python-checkins] python/dist/src/Misc NEWS,1.1356,1.1357
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv805/Tools/scripts
Modified Files:
findnocoding.py pysource.py
Log Message:
Whitespace normalization (via reindent.py).
Index: findnocoding.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/findnocoding.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- findnocoding.py 24 Aug 2005 18:28:41 -0000 1.1
+++ findnocoding.py 26 Aug 2005 15:20:48 -0000 1.2
@@ -26,8 +26,8 @@
if filename.endswith(".py"):
yield os.path.join(root, filename)
pysource = pysource()
-
-
+
+
print >>sys.stderr, ("The pysource module is not available; "
"no sophisticated Python source file search will be done.")
@@ -56,19 +56,19 @@
line1 = infile.readline()
line2 = infile.readline()
-
+
if get_declaration(line1) or get_declaration(line2):
# the file does have an encoding declaration, so trust it
infile.close()
return False
-
+
# check the whole file for non-ASCII characters
rest = infile.read()
infile.close()
-
+
if has_correct_encoding(line1+line2+rest, "ascii"):
return False
-
+
return True
@@ -102,5 +102,3 @@
result = needs_declaration(fullpath)
if result:
print fullpath
-
-
Index: pysource.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/pysource.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pysource.py 24 Aug 2005 18:28:41 -0000 1.1
+++ pysource.py 26 Aug 2005 15:20:48 -0000 1.2
@@ -57,12 +57,12 @@
line = infile.readline()
infile.close()
-
+
if binary_re.search(line):
# file appears to be binary
print_debug("%s: appears to be binary" % fullpath)
return False
-
+
if fullpath.endswith(".py") or fullpath.endswith(".pyw"):
return True
elif "python" in line:
@@ -95,12 +95,12 @@
paths: a list of files and/or directories to be checked.
is_python: a function that takes a file name and checks whether it is a
Python source file
- exclude_dirs: a list of directory base names that should be excluded in
+ exclude_dirs: a list of directory base names that should be excluded in
the search
"""
if exclude_dirs is None:
exclude_dirs=[]
-
+
for path in paths:
print_debug("testing: %s" % path)
if os.path.isfile(path):
- Previous message: [Python-checkins] python/dist/src/Lib/test seq_tests.py, 1.5, 1.6 test_generators.py, 1.47, 1.48 test_hashlib_speed.py, 1.1, 1.2 test_mmap.py, 1.33, 1.34
- Next message: [Python-checkins] python/dist/src/Misc NEWS,1.1356,1.1357
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list