Skip to content

Commit 3f96131

Browse files
Update defaults and rename study_plan to plan_name
Set default mode to `random` instead of `study-plan`. Renamed `study_plan` to `plan_name` across the codebase for clarity and consistency. Updated relevant documentation in the README to reflect these changes.
1 parent b4f96dc commit 3f96131

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

PracticeFactory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ def handle(self, args):
169169
class StudyPlanMode(PracticeMode):
170170
def handle(self, args):
171171
try:
172-
log(f"Selected 🎯 Study Plan Mode: {args['study_plan']}", LogLevel.INFO)
172+
log(f"Selected 🎯 Study Plan Mode: {args['plan_name']}", LogLevel.INFO)
173173

174174
# Use the LeetCodeAPI's fetch_problems method
175-
problem = self.get_random_study_plan_problem(args["study_plan"])
175+
problem = self.get_random_study_plan_problem(args["plan_name"])
176176

177177
if not problem:
178178
log("No problems found for the selected study plan.", LogLevel.ERROR)

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Optional arguments:
7171
- `--difficulty`: Choose between `easy`, `medium`, or `hard` or select multiple using comma-separated list (e.g., `easy,medium`).
7272
- `--open-in-browser`: Opens the problem in a browser window.
7373
- `--editor`: Specify a code editor for writing solutions. Supported editors: `default`, `vim`, `nano`, etc.
74-
- `--editor`: Open the code editor to write solutions. (e.g., `--editor code` or `--editor vim`)
7574

7675
### Custom Mode
7776

@@ -81,10 +80,21 @@ Custom Modes enable solving specific problems or sets of problems by providing o
8180
python3 main.py --mode custom --problems two-sum
8281
```
8382

83+
Optional arguments:
8484
- `--open-in-browser`: Opens the problem in a browser window.
8585
- `--editor`: Specify the preferred code editor (e.g., `vim`, `nano`). Default is the system-configured default editor.
86+
87+
### Study Plan Mode
88+
89+
Study Plan Mode allows you to fetch random problems based on a specific study plan. You can specify the study plan name to fetch problems from that plan.
90+
91+
```bash
92+
python3 main.py --mode study-plan --plan-name top-interview-150
93+
```
94+
95+
Optional arguments:
8696
- `--open-in-browser`: Opens the problem in a browser window.
87-
- `--editor`: Open the code editor to write solutions. (e.g., `--editor code` or `--editor vim`)
97+
- `--editor`: Specify the preferred code editor (e.g., `vim`, `nano`). Default is the system-configured default editor.
8898

8999
## Configurations
90100
Squidleet uses a `LEETCODE_SESSION` cookie for authentication. Setting the `LEETCODE_SESSION` environment variable is necessary for all operations, including fetching and submitting problems.

services/CommandParser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def parse():
99
type=str,
1010
choices=["custom", "random", "study-plan", "daily"],
1111
help="Practice mode",
12-
default="study-plan",
12+
default="random",
1313
)
1414
parser.add_argument(
1515
"--difficulties",
@@ -22,7 +22,7 @@ def parse():
2222
help="Comma-separated problem slugs (e.g., 'two-sum,fizz-buzz')",
2323
)
2424
parser.add_argument(
25-
"--study-plan",
25+
"--plan-name",
2626
type=str,
2727
help="Study plan slug (e.g., 'top-interview-150' or 'leetcode-75')",
2828
default="top-interview-150",

services/InputsCollector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def collect(cli_options):
1414
problems = cli_options.get("problems", "").split(",")
1515

1616
log_level = cli_options.get("log_level", "INFO")
17-
study_plan = cli_options.get("study_plan", "top-interview-150")
17+
plan_name = cli_options.get("study_plan", "top-interview-150")
1818
language = cli_options.get("language", "python")
1919
time_limit = cli_options.get("time_limit", 45)
2020
editor = cli_options.get("editor", "default")
@@ -23,7 +23,7 @@ def collect(cli_options):
2323
inputs = {
2424
"practice_mode": practice_mode,
2525
"difficulties": difficulties,
26-
"study_plan": study_plan,
26+
"plan_name": plan_name,
2727
"problems": problems,
2828
"language": language,
2929
"time_limit": time_limit,
@@ -47,8 +47,8 @@ def _validate(inputs):
4747
if inputs["practice_mode"] == "custom" and not inputs.get("problems"):
4848
raise ValueError("At least one problem is required for Custom Practice mode.")
4949

50-
if inputs["practice_mode"] == "study-plan" and not inputs.get("study_plan"):
51-
raise ValueError("Study plan slug is required for Study Plan mode.")
50+
if inputs["practice_mode"] == "study-plan" and not inputs.get("plan_name"):
51+
raise ValueError("Study plan name is required for Study Plan mode.")
5252

5353
if inputs["difficulties"] and any(
5454
difficulty not in ["easy", "medium", "hard"]

0 commit comments

Comments
 (0)