astyle_client: reformat given source files
This commit is contained in:
parent
927d139488
commit
243db9b69a
|
@ -1,6 +1,6 @@
|
||||||
import glob
|
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def receive_data(conn):
|
def receive_data(conn):
|
||||||
|
@ -29,14 +29,10 @@ def astyle(server_address, code):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
server_address = ('cppcheck.osuosl.org', 18000)
|
server_address = ('cppcheck.osuosl.org', 18000)
|
||||||
|
|
||||||
source_files = []
|
for filename in sorted(sys.argv[1:]):
|
||||||
for d in ['cli', 'gui', 'lib', 'test', 'tools']:
|
if not (filename.endswith('.cpp') or filename.endswith('.h')):
|
||||||
if not os.path.isdir(d) and os.path.isdir('../'+d):
|
continue
|
||||||
d = '../' + d
|
|
||||||
source_files += glob.glob(d + '/*.cpp')
|
|
||||||
source_files += glob.glob(d + '/*.h')
|
|
||||||
|
|
||||||
for filename in sorted(source_files):
|
|
||||||
f = open(filename, 'rt')
|
f = open(filename, 'rt')
|
||||||
code = f.read()
|
code = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
|
Loading…
Reference in New Issue