diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-01-22 02:02:13 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2023-01-22 02:02:13 +0100 |
commit | 86480e58eafc1fa3486e03155ed34e02b4595a24 (patch) | |
tree | 0e8f64c4003ea558e946b7a3347688904b451635 /lib/kformula/scripts/bynames.py | |
parent | 135d005014a1e85295af4e379f026a361537ae5f (diff) | |
download | koffice-86480e58eafc1fa3486e03155ed34e02b4595a24.tar.gz koffice-86480e58eafc1fa3486e03155ed34e02b4595a24.zip |
Drop python2 support in scripts.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'lib/kformula/scripts/bynames.py')
-rwxr-xr-x | lib/kformula/scripts/bynames.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/kformula/scripts/bynames.py b/lib/kformula/scripts/bynames.py index 6b8c1d7a..fbd1ba5e 100755 --- a/lib/kformula/scripts/bynames.py +++ b/lib/kformula/scripts/bynames.py @@ -24,7 +24,7 @@ import time import os def write_header( f ): - print >> f, '''// + print('''// // Created: ''' + time.ctime(time.time()) + ''' // by: ''' + os.path.basename( sys.argv[0] ) + ''' // from: ''' + os.path.basename( sys.argv[1] ) + ''' @@ -49,10 +49,10 @@ def write_header( f ): the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -''' +''', file=f) def write_h( f ): - print >>f, ''' + print(''' #ifndef ENTITIES_H #define ENTITIES_H @@ -74,19 +74,19 @@ extern const entityMap entities[]; KFORMULA_NAMESPACE_END #endif // ENTITIES_H -''' +''', file=f) def write_cc( fr, fw ): - print >> fw, ''' + print(''' #include "entities.h" KFORMULA_NAMESPACE_BEGIN -const entityMap entities[] = {''' +const entityMap entities[] = {''', file=fw) parse( fr, fw ) - print >> fw, ''' + print(''' }; // Needed since sizeof is a macro and we cannot be used until size is known @@ -96,7 +96,7 @@ int entityMap::size() } KFORMULA_NAMESPACE_END - ''' + ''', file=fw) def name_cmp( a, b ): @@ -104,7 +104,7 @@ def name_cmp( a, b ): return -1 if a[0] > b[0]: return 1 - print 'WARNING: Same name in entity: ' + a[0] + ', ' + b[0] + print('WARNING: Same name in entity: ' + a[0] + ', ' + b[0]) return 0; def parse( fr, fw ): @@ -133,10 +133,10 @@ def parse( fr, fw ): while True: e = entries.pop() fd_list.write( e[0] + ' ' + e[1] + '\n') - print >> fw, ' {"' + e[0] + '", ' + e[1] + '}', + print(' {"' + e[0] + '", ' + e[1] + '}', end=' ', file=fw) if len( entries ) == 0: break - print >> fw, ',' + print(',', file=fw) fd_list.close() if __name__ == '__main__': |