All pastes #958793 Raw Edit

Something

public text v1 · immutable
#958793 ·published 2008-03-26 22:44 UTC
rendered paste body
def parse_it(it):
    # parse it, whatever "it" is
    f = {}
    cf = 0
    i = 0
    l = len(it)
    while i<l:
       if (it[i]=='\\') and (it[i+1]==':'):
          i = i + 1
       elif (it[i]==':'):
          cf = cf+1
       else:
          if not f.has_key(cf):
             f[cf]=''
          f[cf]=f[cf] + it[i]
    retval = []
    cf = 0
    for cf in f.keys():
        retval.append(f[cf])
    return retval