Commits

iorodeo committed c7f2244 Draft

Fixed a couple of bugs which where causing issues with the windows versin of the software.

Comments (0)

Files changed (1)

mct_json_converter/mct_json_converter.py

 
         # Initialize arrays based on first item in list
         for k,v in self.jsonData[0].iteritems():
+            k = str(k)
             if ('pts' in k) or ('bndry' in k) or ('midpt' in k):
                 if type(v) != list:
                     v = [v]
                     point = 'p{0}'.format(i+1)
                     self.dictOfArrays[k][point] = scipy.zeros((dataLength,2), dtype=scipy.float64)
             else:
-                if type(v) == str:
+                if type(v) == str or type(v) == unicode:
                     self.dictOfArrays[k] = []
                 else:
                     if type(v) == int:
         # Add data to arrays
         for i, item in enumerate(self.jsonData):
             for k,v in item.iteritems():
+                k = str(k)
                 if ('pts' in k) or ('bndry' in k) or ('midpt' in k):
                     if type(v) != list:
                         v = [v]
                         self.dictOfArrays[k][point][i,0] = subItem['x']
                         self.dictOfArrays[k][point][i,1] = subItem['y']
                 else:
-                    if type(v) == str:
+                    if type(v) == str or type(v) == unicode:
+                        v=str(v)
                         self.dictOfArrays[k].append(v)
                         if k == 'camera':
                             dummy, numStr = v.split('_')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.