diff OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py @ 4047:0327421506ad framework

fix paths in GenerateErrorCodes.py
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Jun 2020 07:53:13 +0200
parents d25f4c0fa160
children bf7b9edf6b81
line wrap: on
line diff
--- a/OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py	Wed Jun 10 21:43:31 2020 +0200
+++ b/OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py	Thu Jun 11 07:53:13 2020 +0200
@@ -37,7 +37,7 @@
 import sys
 
 START_PLUGINS = 1000000
-BASE = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+BASE = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
 
 
 
@@ -45,7 +45,7 @@
 ## Read all the available error codes and HTTP status
 ##
 
-with open(os.path.join(BASE, 'Resources', 'ErrorCodes.json'), 'r') as f:
+with open(os.path.join(BASE, 'OrthancFramework', 'Resources', 'CodeGeneration', 'ErrorCodes.json'), 'r') as f:
     ERRORS = json.loads(re.sub('/\*.*?\*/', '', f.read()))
 
 for error in ERRORS:
@@ -53,7 +53,7 @@
         print('ERROR: Error code must be below %d, but "%s" is set to %d' % (START_PLUGINS, error['Name'], error['Code']))
         sys.exit(-1)
 
-with open(os.path.join(BASE, 'Core', 'Enumerations.h'), 'r') as f:
+with open(os.path.join(BASE, 'OrthancFramework', 'Sources', 'Enumerations.h'), 'r') as f:
     a = f.read()
 
 HTTP = {}
@@ -66,7 +66,7 @@
 ## Generate the "ErrorCode" enumeration in "Enumerations.h"
 ##
 
-path = os.path.join(BASE, 'Core', 'Enumerations.h')
+path = os.path.join(BASE, 'OrthancFramework', 'Sources', 'Enumerations.h')
 with open(path, 'r') as f:
     a = f.read()
 
@@ -84,7 +84,7 @@
 ## Generate the "OrthancPluginErrorCode" enumeration in "OrthancCPlugin.h"
 ##
 
-path = os.path.join(BASE, 'Plugins', 'Include', 'orthanc', 'OrthancCPlugin.h')
+path = os.path.join(BASE, 'OrthancServer', 'Plugins', 'Include', 'orthanc', 'OrthancCPlugin.h')
 with open(path, 'r') as f:
     a = f.read()
 
@@ -103,7 +103,7 @@
 ## "Enumerations.cpp"
 ##
 
-path = os.path.join(BASE, 'Core', 'Enumerations.cpp')
+path = os.path.join(BASE, 'OrthancFramework', 'Sources', 'Enumerations.cpp')
 with open(path, 'r') as f:
     a = f.read()
 
@@ -128,7 +128,7 @@
 ## Generate the "ErrorCode" enumeration in "OrthancSQLiteException.h"
 ##
 
-path = os.path.join(BASE, 'Core', 'SQLite', 'OrthancSQLiteException.h')
+path = os.path.join(BASE, 'OrthancFramework', 'Sources', 'SQLite', 'OrthancSQLiteException.h')
 with open(path, 'r') as f:
     a = f.read()
 
@@ -149,7 +149,7 @@
 ## Generate the "PrintErrors" function in "main.cpp"
 ##
 
-path = os.path.join(BASE, 'OrthancServer', 'main.cpp')
+path = os.path.join(BASE, 'OrthancServer', 'Sources', 'main.cpp')
 with open(path, 'r') as f:
     a = f.read()