-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I'm interested in using this function:
STAREMaster_py/staremaster/products/hdfeos.py
Lines 7 to 32 in af5cba5
| def parse_hdfeos_metadata(string): | |
| out = {} | |
| lines0 = [i.replace('\t','') for i in string.split('\n')] | |
| lines = [] | |
| for line in lines0: | |
| if "=" in line: | |
| key = line.split('=')[0] | |
| value = '='.join(line.split('=')[1:]) | |
| lines.append(key.strip()+'='+value.strip()) | |
| else: | |
| lines.append(line) | |
| i = -1 | |
| while i < (len(lines))-1: | |
| i += 1 | |
| line = lines[i] | |
| if "=" in line: | |
| key = line.split('=')[0] | |
| value = '='.join(line.split('=')[1:])#.join('=') | |
| if key in ['GROUP', 'OBJECT']: | |
| endIdx = lines[i+1:].index('END_{}={}'.format(key, value)) | |
| endIdx += i+1 | |
| out[value] = parse_hdfeos_metadata("\n".join(lines[i+1:endIdx])) | |
| i = endIdx | |
| elif ('END_GROUP' not in key) and ('END_OBJECT' not in key): | |
| out[key] = str(value) | |
| return out |
Does your project have a license so I know if I can incorporate some of your code into mine?
Metadata
Metadata
Assignees
Labels
No labels