Created
March 4, 2016 16:27
-
-
Save barik/f95182341b2805227eff 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
import io | |
import yaml | |
from enum import Enum | |
def process_yaml_file(f): | |
pass | |
class ParseState(Enum): | |
init = 0, | |
find_dict = 1 | |
state = ParseState.init | |
if state == ParseState.init and line.startswith('%YAML:1.0'): | |
yaml_convert.write('%YAML 1.1\n') | |
yaml_convert.write('---\n') | |
state = ParseState.find_dict | |
else: | |
line = line.replace(':', ': ') | |
yaml_convert.write(line) | |
if __name__ == '__main__': | |
yaml_file = open('sample_data/P000_forverify/P604.prj') | |
yaml_convert = io.StringIO() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment