Skip to content

Commit 6ce7972

Browse files
committed
Deleted spaces
1 parent 9fd62a7 commit 6ce7972

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

remove-json-keys/remove-json-keys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Script: remove-json-keys.py
3-
Version: 2025.2.7.1
3+
Version: 2026.1.26
44
Description: Remove key/value pairs from json_folder/**.json
55
Author: Adam Lui
66
URL: https://github.com/adamlui/python-utils
@@ -15,7 +15,7 @@
1515
terminal_width = os.get_terminal_size()[0]
1616
def print_trunc(msg, end='\n'):
1717
truncated_lines = [
18-
line if len(line) < terminal_width else line[:terminal_width - 4] + '...' for line in msg.splitlines() ]
18+
line if len(line) < terminal_width else line[:terminal_width -4] + '...' for line in msg.splitlines() ]
1919
print('\n'.join(truncated_lines), end=end)
2020

2121
print('')

translate-messages/translate-en-messages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Script: translate-en-messages.py
3-
Version: 2026.1.18
3+
Version: 2026.1.26
44
Description: Translate msg's from en/messages.json to [[output_langs]/messages.json]
55
Author: Adam Lui
66
Homepage: https://github.com/adamlui/python-utils
@@ -24,7 +24,7 @@
2424
terminal_width = os.get_terminal_size()[0]
2525
def print_trunc(msg, end='\n'):
2626
truncated_lines = [
27-
line if len(line) < terminal_width else line[:terminal_width - 4] + '...' for line in msg.splitlines() ]
27+
line if len(line) < terminal_width else line[:terminal_width -4] + '...' for line in msg.splitlines() ]
2828
print('\n'.join(truncated_lines), end=end)
2929
def overwrite_print(msg) : stdout.write('\r' + msg.ljust(terminal_width)[:terminal_width])
3030

@@ -128,7 +128,7 @@ def overwrite_print(msg) : stdout.write('\r' + msg.ljust(terminal_width)[:termin
128128
formatted_msg = json.dumps(message_data, ensure_ascii=False) \
129129
.replace('{', '{ ').replace('}', ' }') # add spacing
130130
formatted_msgs += ( f' "{key}": {formatted_msg}'
131-
+ ( ',\n' if idx < len(translated_msgs) - 1 else '\n' )) # terminate line
131+
+ ( ',\n' if idx < len(translated_msgs) -1 else '\n' )) # terminate line
132132
formatted_msgs += '}'
133133
with open(msgs_path, 'w', encoding='utf-8') as output_file : output_file.write(formatted_msgs + '\n')
134134

0 commit comments

Comments
 (0)