Răsfoiți Sursa

Update preprocess.py

BLUELOVETH 2 ani în urmă
părinte
comite
a186f52354
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      preprocess.py

+ 4 - 1
preprocess.py

@@ -25,7 +25,10 @@ namespace pkpy{
     inline static std::map<std::string, const char*> kPythonLibs = {
 '''
     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 += '''