Created
March 27, 2013 17:31
-
-
Save JAlexoid/5256362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_sms(number, number_to, start, time_start, time_end): | |
for i in range(start, len(source)) : | |
entry = source[i] | |
if (entry.type == "sms" and | |
entry.number == number and | |
entry.number_to == number_to and | |
entry.time > time_start and | |
entry.time < time_end) : | |
return entry | |
elif entry.time > time_end: | |
return None | |
for i in range(0, len(source)) : | |
entry = source[i] | |
if entry.type == "call": | |
sms = find_sms(entry.number, | |
entry.number_to, | |
i+1, | |
entry.time, | |
entry.time + 5*60) | |
if sms != None: | |
found_items.append(entry+sms) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment