Specifications

66
elif IsObservations and not IsSummer: print '(ascii) generic winter
observations message',
else: print 'unrecognized message format',
if IsWithInstant:
print '(+ instant.)'
else:
print ''
IsMalformed = IsTooLong or IsTooShort
if IsMalformed:
FoundMalformed += 1
print " WARNING - Message is malformed: any missing value will be
replaced by '?'"
DataLineHash = HashFunc(IMEI + MOMSN + DataLine).hexdigest()
if not DataLineHash in SeenMessageHashes:
if IsMalformed and FilterMalformed:
MalformedFilePath = BaseDir + '\\' + IMEI + '-F.txt'
while True:
try:
with open(MalformedFilePath, 'a') as OutFile:
OutFile.writelines(DataLine+'\n')
if not MalformedFilePath in ModifiedFiles:
ModifiedFiles.append(MalformedFilePath)
break
except IOError:
while True:
AbortOrRetry = raw_input('ERROR while opening %s: Abort or
Retry? [A/R]' %MalformedFilePath)
if AbortOrRetry.upper() in ('A', 'R'): break
if AbortOrRetry.upper() == 'A': break
elif IsDiagnostics:
DiagnosticFilePath = BaseDir + '\\' + IMEI + '-D.txt'
while True:
try:
with open(DiagnosticFilePath, 'a') as OutFile:
OutFile.writelines(DataLine+'\n')
if not DiagnosticFilePath in ModifiedFiles:
ModifiedFiles.append(DiagnosticFilePath)
break
except IOError:
while True:
AbortOrRetry = raw_input('ERROR while opening %s: Abort or
Retry? [A/R]' %DiagnosticFilePath)
if AbortOrRetry.upper() in ('A', 'R'): break
if AbortOrRetry.upper() == 'A': break
elif IsObservations:
ObservationFilePath = BaseDir + '\\' + IMEI + '.txt'