MCPcopy Create free account
hub / github.com/Vanderhoof/PyDBML / parse_project

Function parse_project

pydbml/definitions/project.py:30–50  ·  view source on GitHub ↗

Project project_name { database_type: 'PostgreSQL' Note: 'Description of the project' }

(s, loc, tok)

Source from the content-addressed store, hash-verified

28
29
30def parse_project(s, loc, tok):
31 '''
32 Project project_name {
33 database_type: 'PostgreSQL'
34 Note: 'Description of the project'
35 }
36 '''
37 init_dict = {'name': tok['name']}
38 items = {}
39 for item in tok.get('items', []):
40 if isinstance(item, NoteBlueprint):
41 init_dict['note'] = item
42 else:
43 k, v = item
44 items[k] = v
45 if items:
46 init_dict['items'] = items
47 if 'comment_before' in tok:
48 comment = '\n'.join(c[0] for c in tok['comment_before'])
49 init_dict['comment'] = comment
50 return ProjectBlueprint(**init_dict)
51
52
53project.set_parse_action(parse_project)

Callers

nothing calls this directly

Calls 2

ProjectBlueprintClass · 0.90
getMethod · 0.80

Tested by

no test coverage detected