|
@@ -10,6 +10,7 @@ import mpp.api
|
|
|
|
|
|
import re
|
|
import re
|
|
import os
|
|
import os
|
|
|
|
+import sys
|
|
import logging
|
|
import logging
|
|
import time
|
|
import time
|
|
import binascii
|
|
import binascii
|
|
@@ -142,11 +143,14 @@ class DirectoryReader():
|
|
ts = time.time()
|
|
ts = time.time()
|
|
f = open(full_path, 'rU');
|
|
f = open(full_path, 'rU');
|
|
text = f.read();
|
|
text = f.read();
|
|
|
|
+ # getting along with the different string handling of python 2 and 3
|
|
|
|
+ if sys.version_info[0] < 3:
|
|
|
|
+ text = text.decode('utf-8')
|
|
f.close()
|
|
f.close()
|
|
checksum = binascii.crc32(text.encode('utf8')) & 0xffffffff # to match python 3
|
|
checksum = binascii.crc32(text.encode('utf8')) & 0xffffffff # to match python 3
|
|
|
|
|
|
db_loader = plugin.get_plugin('mpp.dbf').get_loader()
|
|
db_loader = plugin.get_plugin('mpp.dbf').get_loader()
|
|
- (data, is_updated) = db_loader.create_file_data(norm_path, checksum, str(text))
|
|
|
|
|
|
+ (data, is_updated) = db_loader.create_file_data(norm_path, checksum, text)
|
|
procerrors = parser.process(plugin, data, is_updated)
|
|
procerrors = parser.process(plugin, data, is_updated)
|
|
if plugin.is_proctime_enabled == True:
|
|
if plugin.is_proctime_enabled == True:
|
|
data.set_data('std.general', 'proctime',
|
|
data.set_data('std.general', 'proctime',
|