From 0f89280b942eb49745e2cb0321e2ac440ff36d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 26 Jun 2019 20:53:59 +0200 Subject: [PATCH] astyle: tweaks in client --- tools/astyle_client.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tools/astyle_client.py b/tools/astyle_client.py index 2698004e9..b98a0362d 100644 --- a/tools/astyle_client.py +++ b/tools/astyle_client.py @@ -26,26 +26,17 @@ def astyle(server_address, code): sock.close() return None - -def get_source_files(path): - files = [] - for g in glob.glob(path + '*'): - if g.startswith('.'): - continue - if os.path.isdir(g): - files += get_source_files(g + '/') - if os.path.isfile(g) and (g.endswith('.cpp') or g.endswith('.h')): - files.append(g) - return files - if __name__ == "__main__": server_address = ('cppcheck.osuosl.org', 18000) source_files = [] for d in ['cli', 'gui', 'lib', 'test', 'tools']: - source_files += get_source_files(d + '/') + 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 source_files: + for filename in sorted(source_files): f = open(filename, 'rt') code = f.read() f.close()