configurationengine/source/dev-tools/find_tabs.py
changeset 0 2e8eeb919028
equal deleted inserted replaced
-1:000000000000 0:2e8eeb919028
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description:
       
    15 #
       
    16 
       
    17 import os, os.path
       
    18 
       
    19 def main(start):
       
    20     for root, dirs, files in os.walk(start):
       
    21         for fn in files:
       
    22             if not fn.endswith('.py'):
       
    23                 continue
       
    24             full_name = os.path.join(root, fn)
       
    25             f = open(full_name)
       
    26             for index, line in enumerate(f.readlines()):
       
    27                 if '\t' in line:
       
    28                     print '%s:%s: %s' % (full_name, index, line.rstrip())
       
    29             f.close()
       
    30 
       
    31 if __name__ == '__main__':
       
    32     import sys
       
    33     if len(sys.argv):
       
    34         main(sys.argv[1])
       
    35     else:
       
    36         main('.')