mailr20146 - /trunk/devel_scripts/find_unused_imports.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 16, 2013 - 14:31:
Author: bugman
Date: Sun Jun 16 14:31:51 2013
New Revision: 20146

URL: http://svn.gna.org/viewcvs/relax?rev=20146&view=rev
Log:
Improvements to the devel_scripts/find_unused_imports.py script.


Modified:
    trunk/devel_scripts/find_unused_imports.py

Modified: trunk/devel_scripts/find_unused_imports.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/devel_scripts/find_unused_imports.py?rev=20146&r1=20145&r2=20146&view=diff
==============================================================================
--- trunk/devel_scripts/find_unused_imports.py (original)
+++ trunk/devel_scripts/find_unused_imports.py Sun Jun 16 14:31:51 2013
@@ -6,10 +6,15 @@
 from os import getcwd, path, waitpid, sep, walk
 from re import search
 from subprocess import PIPE, Popen
+import sys
 
 
 # Walk through the current dir.
 for root, dirs, files in walk(getcwd()):
+    # Skip SVN directories.
+    if search("svn", root):
+        continue
+
     # Loop over the files.
     for file in files:
         # Only check Python files.
@@ -18,6 +23,7 @@
 
         # Full path to the file.
         path = root + sep + file
+        sys.stdout.write("File %s:\n" % path)
 
         # The command.
         cmd = 'pylint %s' % path
@@ -32,4 +38,4 @@
         # Only display the import information.
         for line in data:
             if search("Unused import", line):
-                print("File:  %s;  %s" % (path, line[:-1]))
+                sys.stdout.write("    %s\n" % line[:-1])




Related Messages


Powered by MHonArc, Updated Sun Jun 16 14:40:02 2013