Skip to content

Commit dcda6c6

Browse files
committed
Condensed SimpleNamespace refs
1 parent 2b30b09 commit dcda6c6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: remove-json-keys.py
3-
Version: 2026.2.10.11
3+
Version: 2026.2.10.12
44
Author: Adam Lui
55
Description: Remove key/value pairs from json_dir/**.json
66
Homepage: https://github.com/adamlui/python-utils
@@ -11,11 +11,11 @@
1111

1212
import argparse
1313
import os, re
14-
from types import SimpleNamespace
14+
from types import SimpleNamespace as sns
1515

16-
cli = SimpleNamespace(
16+
cli = sns(
1717
name='remove-json-keys',
18-
urls=SimpleNamespace(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
18+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
1919
)
2020

2121
# Parse CLI args

translate-messages/translate-en-messages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.17
3+
Version: 2026.2.10.18
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -13,12 +13,12 @@
1313
import os, json
1414
from sys import stdout
1515
from translate import Translator
16-
from types import SimpleNamespace
16+
from types import SimpleNamespace as sns
1717
from urllib.request import urlopen
1818

19-
cli = SimpleNamespace(
19+
cli = sns(
2020
name='translate-messages',
21-
urls=SimpleNamespace(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
21+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
2222
)
2323

2424
provider = ''

0 commit comments

Comments
 (0)