Prepare Open vSwitch 1.1.2 release.
[sliver-openvswitch.git] / ovsdb / ovsdb-idlc.in
1 #! @PYTHON@
2
3 import getopt
4 import os
5 import re
6 import sys
7
8 import ovs.json
9 import ovs.db.error
10 import ovs.db.schema
11
12 argv0 = sys.argv[0]
13
14 def parseSchema(filename):
15     return ovs.db.schema.IdlSchema.from_json(ovs.json.from_file(filename))
16
17 def annotateSchema(schemaFile, annotationFile):
18     schemaJson = ovs.json.from_file(schemaFile)
19     execfile(annotationFile, globals(), {"s": schemaJson})
20     ovs.json.to_stream(schemaJson, sys.stdout)
21
22 def constify(cType, const):
23     if (const and cType.endswith('*') and not cType.endswith('**')):
24         return 'const %s' % cType
25     else:
26         return cType
27
28 def cMembers(prefix, columnName, column, const):
29     type = column.type
30     if type.n_min == 1 and type.n_max == 1:
31         singleton = True
32         pointer = ''
33     else:
34         singleton = False
35         if type.is_optional_pointer():
36             pointer = ''
37         else:
38             pointer = '*'
39
40     if type.value:
41         key = {'name': "key_%s" % columnName,
42                'type': constify(type.key.toCType(prefix) + pointer, const),
43                'comment': ''}
44         value = {'name': "value_%s" % columnName,
45                  'type': constify(type.value.toCType(prefix) + pointer, const),
46                  'comment': ''}
47         members = [key, value]
48     else:
49         m = {'name': columnName,
50              'type': constify(type.key.toCType(prefix) + pointer, const),
51              'comment': type.cDeclComment()}
52         members = [m]
53
54     if not singleton and not type.is_optional_pointer():
55         members.append({'name': 'n_%s' % columnName,
56                         'type': 'size_t ',
57                         'comment': ''})
58     return members
59
60 def printCIDLHeader(schemaFile):
61     schema = parseSchema(schemaFile)
62     prefix = schema.idlPrefix
63     print '''\
64 /* Generated automatically -- do not modify!    -*- buffer-read-only: t -*- */
65
66 #ifndef %(prefix)sIDL_HEADER
67 #define %(prefix)sIDL_HEADER 1
68
69 #include <stdbool.h>
70 #include <stddef.h>
71 #include <stdint.h>
72 #include "ovsdb-data.h"
73 #include "ovsdb-idl-provider.h"
74 #include "uuid.h"''' % {'prefix': prefix.upper()}
75
76     for tableName, table in sorted(schema.tables.iteritems()):
77         structName = "%s%s" % (prefix, tableName.lower())
78
79         print "\f"
80         print "/* %s table. */" % tableName
81         print "struct %s {" % structName
82         print "\tstruct ovsdb_idl_row header_;"
83         for columnName, column in sorted(table.columns.iteritems()):
84             print "\n\t/* %s column. */" % columnName
85             for member in cMembers(prefix, columnName, column, False):
86                 print "\t%(type)s%(name)s;%(comment)s" % member
87         print "};"
88
89         # Column indexes.
90         printEnum(["%s_COL_%s" % (structName.upper(), columnName.upper())
91                    for columnName in sorted(table.columns)]
92                   + ["%s_N_COLUMNS" % structName.upper()])
93
94         print
95         for columnName in table.columns:
96             print "#define %(s)s_col_%(c)s (%(s)s_columns[%(S)s_COL_%(C)s])" % {
97                 's': structName,
98                 'S': structName.upper(),
99                 'c': columnName,
100                 'C': columnName.upper()}
101
102         print "\nextern struct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (structName, structName.upper())
103
104         print '''
105 const struct %(s)s *%(s)s_first(const struct ovsdb_idl *);
106 const struct %(s)s *%(s)s_next(const struct %(s)s *);
107 #define %(S)s_FOR_EACH(ROW, IDL) \\
108         for ((ROW) = %(s)s_first(IDL); \\
109              (ROW); \\
110              (ROW) = %(s)s_next(ROW))
111 #define %(S)s_FOR_EACH_SAFE(ROW, NEXT, IDL) \\
112         for ((ROW) = %(s)s_first(IDL); \\
113              (ROW) ? ((NEXT) = %(s)s_next(ROW), 1) : 0; \\
114              (ROW) = (NEXT))
115
116 void %(s)s_delete(const struct %(s)s *);
117 struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *);
118 ''' % {'s': structName, 'S': structName.upper()}
119
120         for columnName, column in sorted(table.columns.iteritems()):
121             print 'void %(s)s_verify_%(c)s(const struct %(s)s *);' % {'s': structName, 'c': columnName}
122
123         print """
124 /* Functions for fetching columns as \"struct ovsdb_datum\"s.  (This is
125    rarely useful.  More often, it is easier to access columns by using
126    the members of %(s)s directly.) */""" % {'s': structName}
127         for columnName, column in sorted(table.columns.iteritems()):
128             if column.type.value:
129                 valueParam = ', enum ovsdb_atomic_type value_type'
130             else:
131                 valueParam = ''
132             print 'const struct ovsdb_datum *%(s)s_get_%(c)s(const struct %(s)s *, enum ovsdb_atomic_type key_type%(v)s);' % {
133                 's': structName, 'c': columnName, 'v': valueParam}
134
135         print
136         for columnName, column in sorted(table.columns.iteritems()):
137
138             print 'void %(s)s_set_%(c)s(const struct %(s)s *,' % {'s': structName, 'c': columnName},
139             args = ['%(type)s%(name)s' % member for member
140                     in cMembers(prefix, columnName, column, True)]
141             print '%s);' % ', '.join(args)
142
143     # Table indexes.
144     printEnum(["%sTABLE_%s" % (prefix.upper(), tableName.upper()) for tableName in sorted(schema.tables)] + ["%sN_TABLES" % prefix.upper()])
145     print
146     for tableName in schema.tables:
147         print "#define %(p)stable_%(t)s (%(p)stable_classes[%(P)sTABLE_%(T)s])" % {
148             'p': prefix,
149             'P': prefix.upper(),
150             't': tableName.lower(),
151             'T': tableName.upper()}
152     print "\nextern struct ovsdb_idl_table_class %stable_classes[%sN_TABLES];" % (prefix, prefix.upper())
153
154     print "\nextern struct ovsdb_idl_class %sidl_class;" % prefix
155     print "\nvoid %sinit(void);" % prefix
156     print "\n#endif /* %(prefix)sIDL_HEADER */" % {'prefix': prefix.upper()}
157
158 def printEnum(members):
159     if len(members) == 0:
160         return
161
162     print "\nenum {";
163     for member in members[:-1]:
164         print "    %s," % member
165     print "    %s" % members[-1]
166     print "};"
167
168 def printCIDLSource(schemaFile):
169     schema = parseSchema(schemaFile)
170     prefix = schema.idlPrefix
171     print '''\
172 /* Generated automatically -- do not modify!    -*- buffer-read-only: t -*- */
173
174 #include <config.h>
175 #include %s
176 #include <assert.h>
177 #include <limits.h>
178 #include "ovsdb-data.h"
179 #include "ovsdb-error.h"
180
181 static bool inited;
182 ''' % schema.idlHeader
183
184     # Cast functions.
185     for tableName, table in sorted(schema.tables.iteritems()):
186         structName = "%s%s" % (prefix, tableName.lower())
187         print '''
188 static struct %(s)s *
189 %(s)s_cast(const struct ovsdb_idl_row *row)
190 {
191     return row ? CONTAINER_OF(row, struct %(s)s, header_) : NULL;
192 }\
193 ''' % {'s': structName}
194
195
196     for tableName, table in sorted(schema.tables.iteritems()):
197         structName = "%s%s" % (prefix, tableName.lower())
198         print "\f"
199         print "/* %s table. */" % (tableName)
200
201         # Parse functions.
202         for columnName, column in sorted(table.columns.iteritems()):
203             print '''
204 static void
205 %(s)s_parse_%(c)s(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum)
206 {
207     struct %(s)s *row = %(s)s_cast(row_);''' % {'s': structName,
208                                                 'c': columnName}
209
210             type = column.type
211             if type.value:
212                 keyVar = "row->key_%s" % columnName
213                 valueVar = "row->value_%s" % columnName
214             else:
215                 keyVar = "row->%s" % columnName
216                 valueVar = None
217
218             if (type.n_min == 1 and type.n_max == 1) or type.is_optional_pointer():
219                 print
220                 print "    assert(inited);"
221                 print "    if (datum->n >= 1) {"
222                 if not type.key.ref_table:
223                     print "        %s = datum->keys[0].%s;" % (keyVar, type.key.type.to_string())
224                 else:
225                     print "        %s = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_classes[%sTABLE_%s], &datum->keys[0].uuid));" % (keyVar, prefix, type.key.ref_table.lower(), prefix, prefix.upper(), type.key.ref_table.upper())
226
227                 if valueVar:
228                     if type.value.ref_table:
229                         print "        %s = datum->values[0].%s;" % (valueVar, type.value.type.to_string())
230                     else:
231                         print "        %s = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_classes[%sTABLE_%s], &datum->values[0].uuid));" % (valueVar, prefix, type.value.ref_table.lower(), prefix, prefix.upper(), type.value.ref_table.upper())
232                 print "    } else {"
233                 print "        %s" % type.key.initCDefault(keyVar, type.n_min == 0)
234                 if valueVar:
235                     print "        %s" % type.value.initCDefault(valueVar, type.n_min == 0)
236                 print "    }"
237             else:
238                 if type.n_max != sys.maxint:
239                     print "    size_t n = MIN(%d, datum->n);" % type.n_max
240                     nMax = "n"
241                 else:
242                     nMax = "datum->n"
243                 print "    size_t i;"
244                 print
245                 print "    assert(inited);"
246                 print "    %s = NULL;" % keyVar
247                 if valueVar:
248                     print "    %s = NULL;" % valueVar
249                 print "    row->n_%s = 0;" % columnName
250                 print "    for (i = 0; i < %s; i++) {" % nMax
251                 refs = []
252                 if type.key.ref_table:
253                     print "        struct %s%s *keyRow = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_classes[%sTABLE_%s], &datum->keys[i].uuid));" % (prefix, type.key.ref_table.lower(), prefix, type.key.ref_table.lower(), prefix, prefix.upper(), type.key.ref_table.upper())
254                     keySrc = "keyRow"
255                     refs.append('keyRow')
256                 else:
257                     keySrc = "datum->keys[i].%s" % type.key.type.to_string()
258                 if type.value and type.value.ref_table:
259                     print "        struct %s%s *valueRow = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_classes[%sTABLE_%s], &datum->values[i].uuid));" % (prefix, type.value.ref_table.lower(), prefix, type.value.ref_table.lower(), prefix, prefix.upper(), type.value.ref_table.upper())
260                     valueSrc = "valueRow"
261                     refs.append('valueRow')
262                 elif valueVar:
263                     valueSrc = "datum->values[i].%s" % type.value.type.to_string()
264                 if refs:
265                     print "        if (%s) {" % ' && '.join(refs)
266                     indent = "            "
267                 else:
268                     indent = "        "
269                 print "%sif (!row->n_%s) {" % (indent, columnName)
270                 print "%s    %s = xmalloc(%s * sizeof *%s);" % (indent, keyVar, nMax, keyVar)
271                 if valueVar:
272                     print "%s    %s = xmalloc(%s * sizeof *%s);" % (indent, valueVar, nMax, valueVar)
273                 print "%s}" % indent
274                 print "%s%s[row->n_%s] = %s;" % (indent, keyVar, columnName, keySrc)
275                 if valueVar:
276                     print "%s%s[row->n_%s] = %s;" % (indent, valueVar, columnName, valueSrc)
277                 print "%srow->n_%s++;" % (indent, columnName)
278                 if refs:
279                     print "        }"
280                 print "    }"
281             print "}"
282
283         # Unparse functions.
284         for columnName, column in sorted(table.columns.iteritems()):
285             type = column.type
286             if (type.n_min != 1 or type.n_max != 1) and not type.is_optional_pointer():
287                 print '''
288 static void
289 %(s)s_unparse_%(c)s(struct ovsdb_idl_row *row_)
290 {
291     struct %(s)s *row = %(s)s_cast(row_);
292
293     assert(inited);''' % {'s': structName, 'c': columnName}
294                 if type.value:
295                     keyVar = "row->key_%s" % columnName
296                     valueVar = "row->value_%s" % columnName
297                 else:
298                     keyVar = "row->%s" % columnName
299                     valueVar = None
300                 print "    free(%s);" % keyVar
301                 if valueVar:
302                     print "    free(%s);" % valueVar
303                 print '}'
304             else:
305                 print '''
306 static void
307 %(s)s_unparse_%(c)s(struct ovsdb_idl_row *row OVS_UNUSED)
308 {
309     /* Nothing to do. */
310 }''' % {'s': structName, 'c': columnName}
311
312         # First, next functions.
313         print '''
314 const struct %(s)s *
315 %(s)s_first(const struct ovsdb_idl *idl)
316 {
317     return %(s)s_cast(ovsdb_idl_first_row(idl, &%(p)stable_classes[%(P)sTABLE_%(T)s]));
318 }
319
320 const struct %(s)s *
321 %(s)s_next(const struct %(s)s *row)
322 {
323     return %(s)s_cast(ovsdb_idl_next_row(&row->header_));
324 }''' % {'s': structName,
325         'p': prefix,
326         'P': prefix.upper(),
327         'T': tableName.upper()}
328
329         print '''
330 void
331 %(s)s_delete(const struct %(s)s *row)
332 {
333     ovsdb_idl_txn_delete(&row->header_);
334 }
335
336 struct %(s)s *
337 %(s)s_insert(struct ovsdb_idl_txn *txn)
338 {
339     return %(s)s_cast(ovsdb_idl_txn_insert(txn, &%(p)stable_classes[%(P)sTABLE_%(T)s], NULL));
340 }
341 ''' % {'s': structName,
342        'p': prefix,
343        'P': prefix.upper(),
344        'T': tableName.upper()}
345
346         # Verify functions.
347         for columnName, column in sorted(table.columns.iteritems()):
348             print '''
349 void
350 %(s)s_verify_%(c)s(const struct %(s)s *row)
351 {
352     assert(inited);
353     ovsdb_idl_txn_verify(&row->header_, &%(s)s_columns[%(S)s_COL_%(C)s]);
354 }''' % {'s': structName,
355         'S': structName.upper(),
356         'c': columnName,
357         'C': columnName.upper()}
358
359         # Get functions.
360         for columnName, column in sorted(table.columns.iteritems()):
361             if column.type.value:
362                 valueParam = ',\n\tenum ovsdb_atomic_type value_type OVS_UNUSED'
363                 valueType = '\n    assert(value_type == %s);' % column.type.value.toAtomicType()
364                 valueComment = "\n * 'value_type' must be %s." % column.type.value.toAtomicType()
365             else:
366                 valueParam = ''
367                 valueType = ''
368                 valueComment = ''
369             print """
370 /* Returns the %(c)s column's value in 'row' as a struct ovsdb_datum.
371  * This is useful occasionally: for example, ovsdb_datum_find_key() is an
372  * easier and more efficient way to search for a given key than implementing
373  * the same operation on the "cooked" form in 'row'.
374  *
375  * 'key_type' must be %(kt)s.%(vc)s
376  * (This helps to avoid silent bugs if someone changes %(c)s's
377  * type without updating the caller.)
378  *
379  * The caller must not modify or free the returned value.
380  *
381  * Various kinds of changes can invalidate the returned value: modifying
382  * 'column' within 'row', deleting 'row', or completing an ongoing transaction.
383  * If the returned value is needed for a long time, it is best to make a copy
384  * of it with ovsdb_datum_clone(). */
385 const struct ovsdb_datum *
386 %(s)s_get_%(c)s(const struct %(s)s *row,
387 \tenum ovsdb_atomic_type key_type OVS_UNUSED%(v)s)
388 {
389     assert(key_type == %(kt)s);%(vt)s
390     return ovsdb_idl_read(&row->header_, &%(s)s_col_%(c)s);
391 }""" % {'s': structName, 'c': columnName,
392        'kt': column.type.key.toAtomicType(),
393        'v': valueParam, 'vt': valueType, 'vc': valueComment}
394
395         # Set functions.
396         for columnName, column in sorted(table.columns.iteritems()):
397             type = column.type
398             print '\nvoid'
399             members = cMembers(prefix, columnName, column, True)
400             keyVar = members[0]['name']
401             nVar = None
402             valueVar = None
403             if type.value:
404                 valueVar = members[1]['name']
405                 if len(members) > 2:
406                     nVar = members[2]['name']
407             else:
408                 if len(members) > 1:
409                     nVar = members[1]['name']
410             print '%(s)s_set_%(c)s(const struct %(s)s *row, %(args)s)' % \
411                 {'s': structName, 'c': columnName,
412                  'args': ', '.join(['%(type)s%(name)s' % m for m in members])}
413             print "{"
414             print "    struct ovsdb_datum datum;"
415             if type.n_min == 1 and type.n_max == 1:
416                 print
417                 print "    assert(inited);"
418                 print "    datum.n = 1;"
419                 print "    datum.keys = xmalloc(sizeof *datum.keys);"
420                 print "    " + type.key.copyCValue("datum.keys[0].%s" % type.key.type.to_string(), keyVar)
421                 if type.value:
422                     print "    datum.values = xmalloc(sizeof *datum.values);"
423                     print "    "+ type.value.copyCValue("datum.values[0].%s" % type.value.type.to_string(), valueVar)
424                 else:
425                     print "    datum.values = NULL;"
426             elif type.is_optional_pointer():
427                 print
428                 print "    assert(inited);"
429                 print "    if (%s) {" % keyVar
430                 print "        datum.n = 1;"
431                 print "        datum.keys = xmalloc(sizeof *datum.keys);"
432                 print "        " + type.key.copyCValue("datum.keys[0].%s" % type.key.type.to_string(), keyVar)
433                 print "    } else {"
434                 print "        datum.n = 0;"
435                 print "        datum.keys = NULL;"
436                 print "    }"
437                 print "    datum.values = NULL;"
438             else:
439                 print "    size_t i;"
440                 print
441                 print "    assert(inited);"
442                 print "    datum.n = %s;" % nVar
443                 print "    datum.keys = xmalloc(%s * sizeof *datum.keys);" % nVar
444                 if type.value:
445                     print "    datum.values = xmalloc(%s * sizeof *datum.values);" % nVar
446                 else:
447                     print "    datum.values = NULL;"
448                 print "    for (i = 0; i < %s; i++) {" % nVar
449                 print "        " + type.key.copyCValue("datum.keys[i].%s" % type.key.type.to_string(), "%s[i]" % keyVar)
450                 if type.value:
451                     print "        " + type.value.copyCValue("datum.values[i].%s" % type.value.type.to_string(), "%s[i]" % valueVar)
452                 print "    }"
453                 if type.value:
454                     valueType = type.value.toAtomicType()
455                 else:
456                     valueType = "OVSDB_TYPE_VOID"
457                 print "    ovsdb_datum_sort_unique(&datum, %s, %s);" % (
458                     type.key.toAtomicType(), valueType)
459             print "    ovsdb_idl_txn_write(&row->header_, &%(s)s_columns[%(S)s_COL_%(C)s], &datum);" \
460                 % {'s': structName,
461                    'S': structName.upper(),
462                    'C': columnName.upper()}
463             print "}"
464
465         # Table columns.
466         print "\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (
467             structName, structName.upper())
468         print """
469 static void\n%s_columns_init(void)
470 {
471     struct ovsdb_idl_column *c;\
472 """ % structName
473         for columnName, column in sorted(table.columns.iteritems()):
474             cs = "%s_col_%s" % (structName, columnName)
475             d = {'cs': cs, 'c': columnName, 's': structName}
476             print
477             print "    /* Initialize %(cs)s. */" % d
478             print "    c = &%(cs)s;" % d
479             print "    c->name = \"%(c)s\";" % d
480             print column.type.cInitType("    ", "c->type")
481             print "    c->parse = %(s)s_parse_%(c)s;" % d
482             print "    c->unparse = %(s)s_unparse_%(c)s;" % d
483         print "}"
484
485     # Table classes.
486     print "\f"
487     print "struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper())
488     for tableName, table in sorted(schema.tables.iteritems()):
489         structName = "%s%s" % (prefix, tableName.lower())
490         if table.is_root:
491             is_root = "true"
492         else:
493             is_root = "false"
494         print "    {\"%s\", %s," % (tableName, is_root)
495         print "     %s_columns, ARRAY_SIZE(%s_columns)," % (
496             structName, structName)
497         print "     sizeof(struct %s)}," % structName
498     print "};"
499
500     # IDL class.
501     print "\nstruct ovsdb_idl_class %sidl_class = {" % prefix
502     print "    \"%s\", %stable_classes, ARRAY_SIZE(%stable_classes)" % (
503         schema.name, prefix, prefix)
504     print "};"
505
506     # global init function
507     print """
508 void
509 %sinit(void)
510 {
511     if (inited) {
512         return;
513     }
514     inited = true;
515 """ % prefix
516     for tableName, table in sorted(schema.tables.iteritems()):
517         structName = "%s%s" % (prefix, tableName.lower())
518         print "    %s_columns_init();" % structName
519     print "}"
520
521 def ovsdb_escape(string):
522     def escape(match):
523         c = match.group(0)
524         if c == '\0':
525             raise ovs.db.error.Error("strings may not contain null bytes")
526         elif c == '\\':
527             return '\\\\'
528         elif c == '\n':
529             return '\\n'
530         elif c == '\r':
531             return '\\r'
532         elif c == '\t':
533             return '\\t'
534         elif c == '\b':
535             return '\\b'
536         elif c == '\a':
537             return '\\a'
538         else:
539             return '\\x%02x' % ord(c)
540     return re.sub(r'["\\\000-\037]', escape, string)
541
542
543
544 def usage():
545     print """\
546 %(argv0)s: ovsdb schema compiler
547 usage: %(argv0)s [OPTIONS] COMMAND ARG...
548
549 The following commands are supported:
550   annotate SCHEMA ANNOTATIONS print SCHEMA combined with ANNOTATIONS
551   c-idl-header IDL            print C header file for IDL
552   c-idl-source IDL            print C source file for IDL implementation
553   nroff IDL                   print schema documentation in nroff format
554
555 The following options are also available:
556   -h, --help                  display this help message
557   -V, --version               display version information\
558 """ % {'argv0': argv0}
559     sys.exit(0)
560
561 if __name__ == "__main__":
562     try:
563         try:
564             options, args = getopt.gnu_getopt(sys.argv[1:], 'C:hV',
565                                               ['directory',
566                                                'help',
567                                                'version'])
568         except getopt.GetoptError, geo:
569             sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
570             sys.exit(1)
571
572         for key, value in options:
573             if key in ['-h', '--help']:
574                 usage()
575             elif key in ['-V', '--version']:
576                 print "ovsdb-idlc (Open vSwitch) @VERSION@"
577             elif key in ['-C', '--directory']:
578                 os.chdir(value)
579             else:
580                 sys.exit(0)
581
582         optKeys = [key for key, value in options]
583
584         if not args:
585             sys.stderr.write("%s: missing command argument "
586                              "(use --help for help)\n" % argv0)
587             sys.exit(1)
588
589         commands = {"annotate": (annotateSchema, 2),
590                     "c-idl-header": (printCIDLHeader, 1),
591                     "c-idl-source": (printCIDLSource, 1)}
592
593         if not args[0] in commands:
594             sys.stderr.write("%s: unknown command \"%s\" "
595                              "(use --help for help)\n" % (argv0, args[0]))
596             sys.exit(1)
597
598         func, n_args = commands[args[0]]
599         if len(args) - 1 != n_args:
600             sys.stderr.write("%s: \"%s\" requires %d arguments but %d "
601                              "provided\n"
602                              % (argv0, args[0], n_args, len(args) - 1))
603             sys.exit(1)
604
605         func(*args[1:])
606     except ovs.db.error.Error, e:
607         sys.stderr.write("%s: %s\n" % (argv0, e))
608         sys.exit(1)
609
610 # Local variables:
611 # mode: python
612 # End: