From 243db9b69af6fcb4a6d4e3e1d1edde0cf2123a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 27 Jun 2019 09:23:55 +0200 Subject: [PATCH] astyle_client: reformat given source files --- tools/astyle_client.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/astyle_client.py b/tools/astyle_client.py index b98a0362d..526df5d59 100644 --- a/tools/astyle_client.py +++ b/tools/astyle_client.py @@ -1,6 +1,6 @@ -import glob import os import socket +import sys import time def receive_data(conn): @@ -29,14 +29,10 @@ def astyle(server_address, code): if __name__ == "__main__": server_address = ('cppcheck.osuosl.org', 18000) - source_files = [] - for d in ['cli', 'gui', 'lib', 'test', 'tools']: - if not os.path.isdir(d) and os.path.isdir('../'+d): - d = '../' + d - source_files += glob.glob(d + '/*.cpp') - source_files += glob.glob(d + '/*.h') + for filename in sorted(sys.argv[1:]): + if not (filename.endswith('.cpp') or filename.endswith('.h')): + continue - for filename in sorted(source_files): f = open(filename, 'rt') code = f.read() f.close()