(core) Simple Python 3 compatibility changes

Summary: Changes that move towards python 3 compatibility that are easy to review without much thought

Test Plan: The tests

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2873
This commit is contained in:
Alex Hall
2021-06-22 17:12:25 +02:00
parent cc04c6481a
commit 16f297a250
66 changed files with 551 additions and 437 deletions

View File

@@ -24,29 +24,29 @@ def get_ts_type(col_type):
return _ts_types.get(col_type, "CellValue")
def main():
print """
print("""
/*** THIS FILE IS AUTO-GENERATED BY %s ***/
// tslint:disable:object-literal-key-quotes
export const schema = {
""" % __file__
""" % __file__)
for table in schema.schema_create_actions():
print ' "%s": {' % table.table_id
print(' "%s": {' % table.table_id)
for column in table.columns:
print ' %-20s: "%s",' % (column['id'], column['type'])
print ' },\n'
print(' %-20s: "%s",' % (column['id'], column['type']))
print(' },\n')
print """};
print("""};
export interface SchemaTypes {
"""
""")
for table in schema.schema_create_actions():
print ' "%s": {' % table.table_id
print(' "%s": {' % table.table_id)
for column in table.columns:
print ' %s: %s;' % (column['id'], get_ts_type(column['type']))
print ' };\n'
print "}"
print(' %s: %s;' % (column['id'], get_ts_type(column['type'])))
print(' };\n')
print("}")
if __name__ == '__main__':
main()