goa/tools/generate_schema_img.py
branchtls-sprint
changeset 1802 d628defebc17
parent 0 b97547f5f1fa
child 1977 606923dff11b
equal deleted inserted replaced
1801:672acc730ce5 1802:d628defebc17
     1 import sys
     1 import sys
     2 from os.path import dirname, abspath, join
     2 from os.path import dirname, abspath, join
     3 from yams import schema2dot 
     3 from yams import schema2dot
     4 
     4 
     5 APPLROOT = abspath(join(dirname(abspath(__file__)), '..'))
     5 APPLROOT = abspath(join(dirname(abspath(__file__)), '..'))
     6 
     6 
     7 try:
     7 try:
     8     import custom
     8     import custom
     9 except ImportError:
     9 except ImportError:
    10     sys.path.insert(0, APPLROOT)
    10     sys.path.insert(0, APPLROOT)
    11     import custom
    11     import custom
    12     
    12 
    13 
    13 
    14 schema = custom.SCHEMA
    14 schema = custom.SCHEMA
    15 skip_rels = ('owned_by', 'created_by', 'identity', 'is', 'is_instance_of')
    15 skip_rels = ('owned_by', 'created_by', 'identity', 'is', 'is_instance_of')
    16 path = join(APPLROOT, 'data', 'schema.png')
    16 path = join(APPLROOT, 'data', 'schema.png')
    17 schema2dot.schema2dot(schema, path, #size=size,
    17 schema2dot.schema2dot(schema, path, #size=size,