# HG changeset patch # User Julien Cristau # Date 1391096919 -3600 # Node ID 562cef272a35b6a4bb597fbd581541284071df82 # Parent 2904e2ba81a060f58c41ba733725eb7d3daffc55 [schemaserial] Replace 'cursor' with 'cnx' We don't have cursors in rql, since execute is synchronous. diff -r 2904e2ba81a0 -r 562cef272a35 server/schemaserial.py --- a/server/schemaserial.py Wed Jan 29 16:03:42 2014 +0100 +++ b/server/schemaserial.py Thu Jan 30 16:48:39 2014 +0100 @@ -33,7 +33,7 @@ from cubicweb.server import sqlutils -def group_mapping(cursor, interactive=True): +def group_mapping(cnx, interactive=True): """create a group mapping from an rql cursor A group mapping has standard group names as key (managers, owners at least) @@ -42,7 +42,7 @@ from the user. """ res = {} - for eid, name in cursor.execute('Any G, N WHERE G is CWGroup, G name N', + for eid, name in cnx.execute('Any G, N WHERE G is CWGroup, G name N', build_descr=False): res[name] = eid if not interactive: @@ -305,7 +305,7 @@ # schema / perms serialization ################################################ -def serialize_schema(cursor, schema): +def serialize_schema(cnx, schema): """synchronize schema and permissions in the database according to current schema """ @@ -313,7 +313,7 @@ if not quiet: _title = '-> storing the schema in the database ' print _title, - execute = cursor.execute + execute = cnx.execute eschemas = schema.entities() if not quiet: pb_size = (len(eschemas + schema.relations()) @@ -322,7 +322,7 @@ pb = ProgressBar(pb_size, title=_title) else: pb = None - groupmap = group_mapping(cursor, interactive=False) + groupmap = group_mapping(cnx, interactive=False) # serialize all entity types, assuring CWEType is serialized first for proper # is / is_instance_of insertion eschemas.remove(schema.eschema('CWEType'))