Skip to content

Instantly share code, notes, and snippets.

@JAlexoid
Created March 27, 2013 17:31
Show Gist options
  • Save JAlexoid/5256362 to your computer and use it in GitHub Desktop.
Save JAlexoid/5256362 to your computer and use it in GitHub Desktop.
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