Script Error Error in plugin execution compileExecuteSource:
Traceback (most recent call last):
File "plugin.py", line 201, in compileExecuteSource
File "plugin.py", line 190, in _compileExecuteSource
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'lstrip'
Can you tell me why Indigo's plugin.py doesn't like the script?
- Code: Select all
from __future__ import with_statement
from datetime import date
import linecache
import os
fileDate = str(date.today())
theBody = []
baseDir = '/Library/Application Support/Perceptive Automation/Indigo 5/Logs'
tmpFileName = os.path.join(baseDir, 'tmp.txt')
log = os.path.join(baseDir, fileDate + ' Events.txt')
with open(tmpFileName) as tmpFile:
prenumLines = sum(1 for line in tmpFile)
with open(tmpFileName, 'w') as tmpFile:
with open(log, 'r') as logFile:
for line in logFile:
if 'Error' in line:
tmpFile.write(line )
with open(tmpFileName) as tmpFile:
postnumLines = sum(1 for line in tmpFile)
lineNum = prenumLines
with open(tmpFileName) as tmpFile:
while lineNum < postnumLines:
theBody.append(linecache.getline(tmpFileName, lineNum + 1) )
lineNum = lineNum + 1
#theBody is the body of an email to be sent next
theBody = "".join(theBody)