Mercurial > hg > orthanc
diff Resources/GenerateErrorCodes.py @ 1733:e1f5ab395297
PrintErrors
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 21 Oct 2015 14:10:55 +0200 |
parents | da799f767e5d |
children | e2675b37eb01 |
line wrap: on
line diff
--- a/Resources/GenerateErrorCodes.py Wed Oct 21 11:53:26 2015 +0200 +++ b/Resources/GenerateErrorCodes.py Wed Oct 21 14:10:55 2015 +0200 @@ -141,3 +141,20 @@ with open(path, 'w') as f: f.write(a) + + + +## +## Generate the "PrintErrors" function in "main.cpp" +## + +path = os.path.join(BASE, 'OrthancServer', 'main.cpp') +with open(path, 'r') as f: + a = f.read() + +s = '\n'.join(map(lambda x: ' PrintError(%d, "%s");' % (x['Code'], x['Name']), ERRORS)) + +print s + +#with open(path, 'w') as f: +# f.write(a)