Selaa lähdekoodia

Update preprocess.py

BLUELOVETH 2 vuotta sitten
vanhempi
commit
a186f52354
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      preprocess.py

+ 4 - 1
preprocess.py

@@ -25,7 +25,10 @@ namespace pkpy{
     inline static std::map<std::string, const char*> kPythonLibs = {
     inline static std::map<std::string, const char*> kPythonLibs = {
 '''
 '''
     for key, value in sources.items():
     for key, value in sources.items():
-        header += ' '*8 + '{"' + key + '", "' + value + '"},'
+        CHAR_LIMIT = 5000
+        value = ['"' + value[i:i+CHAR_LIMIT] + '" ' for i in range(0, len(value), CHAR_LIMIT)]
+        value = ''.join(value)
+        header += ' '*8 + '{"' + key + '", ' + value + '},'
         header += '\n'
         header += '\n'
 
 
     header += '''
     header += '''