Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0106b35

Browse files
committed
havent handled wrong testcase result yet, added --user-alng , user default lang, fixed python2 error added ispaid $$$
1 parent 4f80664 commit 0106b35

File tree

4 files changed

+345
-298
lines changed

4 files changed

+345
-298
lines changed

code_editor/1929_concatenation-of-array.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

color.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Colors:
2+
YELLOW = "\033[1;33m" # Bold yellow
23
GREEN = "\033[1;32m" # Bold green
34
ORANGE = "\033[1;33m" # Bold orange
45
RED = "\033[1;31m" # Bold red

config_setup.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,23 @@ def load_credentials_from_config():
1515
with open(CONFIG_FILE_PATH, "r") as config_file:
1616
config_data = toml.load(config_file)
1717
return config_data.get("LEETCODE_SESSION"), config_data.get("CSRF_TOKEN")
18-
return None, None
18+
return None, None
19+
20+
21+
def load_user_data_from_config():
22+
if os.path.exists(CONFIG_FILE_PATH):
23+
with open(CONFIG_FILE_PATH, "r") as config_file:
24+
config_data = toml.load(config_file)
25+
return config_data.get("USER_LANG", "").lower()
26+
return None
27+
28+
29+
def save_user_data_to_config(user_lang):
30+
config_data = {"USER_LANG": user_lang}
31+
if os.path.exists(CONFIG_FILE_PATH):
32+
with open(CONFIG_FILE_PATH, "r") as config_file:
33+
existing_config_data = toml.load(config_file)
34+
existing_config_data.update(config_data)
35+
config_data = existing_config_data
36+
with open(CONFIG_FILE_PATH, "w") as config_file:
37+
toml.dump(config_data, config_file)

0 commit comments

Comments
 (0)