Skip to content

Instantly share code, notes, and snippets.

@pslobo
Created November 14, 2013 16:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pslobo/7469760 to your computer and use it in GitHub Desktop.
Save pslobo/7469760 to your computer and use it in GitHub Desktop.
t = '''Inbox:
Project 01:
- Task 01
this is a comment
this is still a comment associate with task 01
- sub 01
- sub 02
- sub 05
- Task 02
- Task 03
- sub 03
- sub 04
Project 02:
- Task 01
- proj 2 sub 01
- Task 02
- Task 03
- Task 04'''
allTasks = t.split('\n\n')
projects = [filter(None,proj.split('\n\t')) for proj in allTasks]
for i in projects:
if len(i[1:])>0:
print i[0]
print i[1]
for s in range(2,len(i[1:])):
if i[s].startswith("\t") or not i[s].startswith("-"):
print i[s]
else:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment