Skip to content

Commit db7b868

Browse files
committed
fix mdcal
1 parent 93df943 commit db7b868

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mdcal.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def get_dict(lang='en'):
5454
return dic
5555

5656
def update_calendar(year, month, day, with_isoweek=False, start_from_Sun=False, lang="en"):
57-
# Check if DailyLC.md exists, if not, create one
57+
# Check if README.md exists, if not, create one
5858
if not os.path.exists('DailyLC.md'):
5959
with open('DailyLC.md', 'w') as f:
6060
print("The file DailyLC.md does not exist. Creating a new one...")
6161
f.write('## 🎯 Calendar\n\n## Records\n\n')
6262

63-
# Read the content of DailyLC.md
64-
with open('DailyLC.md', 'r') as file:
63+
# Read the content of README.md
64+
with open('README.md', 'r') as file:
6565
content = file.read()
6666

6767
# Extract the part between "## 🎯 Calendar" to the start of the next section "## Records".
@@ -100,13 +100,13 @@ def update_calendar(year, month, day, with_isoweek=False, start_from_Sun=False,
100100
star_flag = False
101101
calendar_section_lines[i] = "|".join(day_cells)
102102

103-
# Replace 'Calendar' section in DailyLC.md with the updated section
103+
# Replace 'Calendar' section in README.md with the updated section
104104
new_content = re.sub(r"## 🎯 Calendar(.*)(?=## 🍃 Records)", "\n".join(calendar_section_lines), content, flags=re.DOTALL)
105105

106-
with open('DailyLC.md', 'w') as file:
106+
with open('README.md', 'w') as file:
107107
file.write(new_content)
108108

109-
return "Successfully updated Calendar of DailyLC.md"
109+
return "Successfully updated Calendar of README.md"
110110

111111
if __name__ == "__main__":
112112
argv = sys.argv

0 commit comments

Comments
 (0)