Skip to content

Instantly share code, notes, and snippets.

@barik
Created March 4, 2016 16:27
Show Gist options
  • Save barik/f95182341b2805227eff to your computer and use it in GitHub Desktop.
Save barik/f95182341b2805227eff to your computer and use it in GitHub Desktop.
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