server/schemaserial.py
changeset 8748 f5027f8d2478
parent 8695 358d8bed9626
child 8945 ba9e3fbfa5a5
equal deleted inserted replaced
8747:c0d4244e5abc 8748:f5027f8d2478
    24 
    24 
    25 from logilab.common.shellutils import ProgressBar
    25 from logilab.common.shellutils import ProgressBar
    26 
    26 
    27 from yams import BadSchemaDefinition, schema as schemamod, buildobjs as ybo
    27 from yams import BadSchemaDefinition, schema as schemamod, buildobjs as ybo
    28 
    28 
    29 from cubicweb import CW_SOFTWARE_ROOT, typed_eid
    29 from cubicweb import CW_SOFTWARE_ROOT
    30 from cubicweb.schema import (CONSTRAINTS, ETYPE_NAME_MAP,
    30 from cubicweb.schema import (CONSTRAINTS, ETYPE_NAME_MAP,
    31                              VIRTUAL_RTYPES, PURE_VIRTUAL_RTYPES)
    31                              VIRTUAL_RTYPES, PURE_VIRTUAL_RTYPES)
    32 from cubicweb.server import sqlutils
    32 from cubicweb.server import sqlutils
    33 
    33 
    34 def group_mapping(cursor, interactive=True):
    34 def group_mapping(cursor, interactive=True):
    56             while True:
    56             while True:
    57                 value = raw_input('eid for group %s: ' % group).strip()
    57                 value = raw_input('eid for group %s: ' % group).strip()
    58                 if not value:
    58                 if not value:
    59                     continue
    59                     continue
    60                 try:
    60                 try:
    61                     eid = typed_eid(value)
    61                     eid = int(value)
    62                 except ValueError:
    62                 except ValueError:
    63                     print 'eid should be an integer'
    63                     print 'eid should be an integer'
    64                     continue
    64                     continue
    65                 for eid_ in res.values():
    65                 for eid_ in res.values():
    66                     if eid == eid_:
    66                     if eid == eid_: