Skip to content

Commit

Permalink
Revert debug changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilshan-H committed Nov 15, 2023
1 parent f20b031 commit f5e1663
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/convert_ics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ jobs:
git config --global user.name "GitHub Actions"
csv_branch_name="csv-files-$year"
git checkout -b "$csv_branch_name"
tree ..
python converters/icalendar_to_csv.py "$file"
echo
tree ..
git status
git add "csv/$year.csv"
git commit -m "Convert $year.ics to $year.csv [skip ci]"
git push origin "$csv_branch_name"
Expand Down
6 changes: 0 additions & 6 deletions converters/icalendar_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@ def ics_to_csv(file_path):
with open(file_path, "r", encoding="utf-8") as file:
cal = Calendar.from_ical(file.read())

print(os.curdir)
print(os.pardir)
print(os.path.abspath(os.path.join(os.curdir, os.pardir)))

csv_dir = os.path.abspath(
os.path.join(os.curdir, os.pardir, "srilanka-holidays", CSV_DIR_NAME)
)
os.makedirs(csv_dir, exist_ok=True)
print(f"Created directory: {csv_dir}")

# Get the filename (without extension) from the input path
file_name = os.path.splitext(os.path.basename(file_path))[0]

# Create the CSV file path
csv_file_path = os.path.join(csv_dir, f"{file_name}.csv")
print(f"CSV file path: {csv_file_path}")

with open(csv_file_path, "w", newline="", encoding="utf-8") as file:
fieldnames = [
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"Ramazan",
"Sinhala",
"Sivarathri",
"srilanka",
"Unduvap",
"VCALENDAR",
"Vesak",
Expand Down
8 changes: 0 additions & 8 deletions ics/2021.ics
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,4 @@ DTEND;VALUE=DATE:20211226
SUMMARY:Christmas Day
DESCRIPTION:Public,Bank,Mercantile
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_26
DTSTART;VALUE=DATE:20211230
DTEND;VALUE=DATE:20211231
SUMMARY:Temp Holiday v10
DESCRIPTION:Public,Bank,Mercantile
END:VEVENT
END:VCALENDAR

0 comments on commit f5e1663

Please sign in to comment.