Skip to content

Commit db1f2ca

Browse files
committed
Split lines up, eliminated/renamed vars
1 parent b54859f commit db1f2ca

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

  • remove-json-keys/src/remove_json_keys/lib/data
  • translate-messages/src/translate_messages/lib/data
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
def read(file_path):
2-
with open(file_path, 'r', encoding='utf-8') as file : file_content = file.read()
3-
return file_content
2+
with open(file_path, 'r', encoding='utf-8') as file:
3+
return file.read()
44

55
def write(file_path, file_content):
6-
with open(file_path, 'w', encoding='utf-8') as file : file.write(file_content)
6+
with open(file_path, 'w', encoding='utf-8') as file:
7+
file.write(file_content)

remove-json-keys/src/remove_json_keys/lib/data/json.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import json, os, re
22
from . import file
33

4-
def read(json_path):
5-
if not os.path.exists(json_path) : return {}
6-
with open(json_path, 'r', encoding='utf-8') as file : return json.load(file)
4+
def read(file_path):
5+
if not os.path.exists(file_path):
6+
return {}
7+
with open(file_path, 'r', encoding='utf-8') as file:
8+
return json.load(file)
79

810
def remove_keys(cli):
911
keys_removed, keys_skipped, files_processed_cnt = [], [], 0
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
def read(file_path):
2-
with open(file_path, 'r', encoding='utf-8') as file : file_content = file.read()
3-
return file_content
2+
with open(file_path, 'r', encoding='utf-8') as file:
3+
return file.read()
44

55
def write(file_path, file_content):
6-
with open(file_path, 'w', encoding='utf-8') as file : file.write(file_content)
6+
with open(file_path, 'w', encoding='utf-8') as file:
7+
file.write(file_content)

0 commit comments

Comments
 (0)