From 8f2d230daaa4d90dbacaac799c142cc1b4f07233 Mon Sep 17 00:00:00 2001 From: mnjx Date: Mon, 26 Jun 2023 17:23:38 +0200 Subject: [PATCH] Mon Jun 26 15:25:26 CEST 2023 --- .gitignore | 5 ++--- README.md | 12 +++++++----- src/lib/schedule_week.py | 3 ++- src/main.py | 20 ++++++++++---------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 9029aae..63425f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.pyc -src/lib/data/*.csv -src/lib/shadow -TODO.md *.swp + +TODO.md diff --git a/README.md b/README.md index 42820f9..f2d7206 100755 --- a/README.md +++ b/README.md @@ -19,14 +19,16 @@ Insiration was taken from [@JakubAndrysek](https://github.com/JakubAndrysek)'s [ **Clone the repo** -HTTPS: `git clone https://github.com/mnjx/solen` -SSH: `git clone git@github.com:mnjx/solen.git` +| Method | Command | +| ------ | ----------------------------------------- | +| HTTPS | `git clone https://github.com/mnjx/solen` | +| SSH | `git clone git@github.com:mnjx/solen.git` | **Navigate into the repo directory** `cd solen` -**Install** *(superuser privileges required)* +**Install** `sudo make install` @@ -34,8 +36,8 @@ SSH: `git clone git@github.com:mnjx/solen.git` | Location | Command | | ------------------------------ | ---------- | -| From the repo folder: | `make run` | -| From anywhere on the computer: | `solen` | +| From the repo folder | `make run` | +| From anywhere on the computer | `solen` | # Usage diff --git a/src/lib/schedule_week.py b/src/lib/schedule_week.py index d3d1cdb..a5ab4d1 100755 --- a/src/lib/schedule_week.py +++ b/src/lib/schedule_week.py @@ -316,6 +316,7 @@ def schedule_to_file(password, username, schedule=None): lstrdata.append("\n") lstrdata.append(row["DATE"]) + lstrdata.append(",") for i in row["WHERES"]: lstrdata.append(i) lstrdata.append(",") @@ -370,5 +371,5 @@ def schedule_from_file(password, username) -> list: temp["WHERES"] = wheres schedule.append(temp) - + print(schedule) return schedule diff --git a/src/main.py b/src/main.py index 576e0b5..5185997 100755 --- a/src/main.py +++ b/src/main.py @@ -11,18 +11,18 @@ import os from datetime import datetime if __name__ == "__main__": - parser = argparse.ArgumentParser(prog="ŠOLEn", description="ŠOLEn, an enhanced version of the ŠkolaOnLine online school system") + parser = argparse.ArgumentParser(prog="solen", description="solen, an enhanced version of the ŠkolaOnLine online school system") - parser.add_argument("-t", "--today-tomorrow", action="store_true", help="Show the schedule for today and tomorrow") - parser.add_argument("-w", "--week", action="store_true", help="Show the schedule for this week") - parser.add_argument("-g", "--grades", action="store_true", help="Show the grades") - parser.add_argument("-u", "--username", action="store", default="", help="Provide the username for login") - parser.add_argument("-p", "--password", action="store", default="", help="Provide the password for login") - parser.add_argument("-l", "--local", action="store_true", help="Only fetch local files, don't connect to the internet") - parser.add_argument("-d", "--delete-local-files", action="store_true", help="Delete all local user data, including schedules, grades and user credentials") + parser.add_argument("-t", "--today-tomorrow", action="store_true", help="show the schedule for today and tomorrow") + parser.add_argument("-w", "--week", action="store_true", help="show the schedule for this week") + parser.add_argument("-g", "--grades", action="store_true", help="show the grades") + parser.add_argument("-u", "--username", action="store", default="", help="provide the username for login") + parser.add_argument("-p", "--password", action="store", default="", help="provide the password for login") + parser.add_argument("-l", "--local", action="store_true", help="only fetch local files, don't connect to the internet") + parser.add_argument("-d", "--delete-local-files", action="store_true", help="delete all local user data, including schedules, grades and user credentials") - parser.add_argument("-b", "--backup", action="store_true", help="Back up all user data and store them in a .tar.gz archive in the destination directory") - parser.add_argument("-R", "--backup-restore", action="store", nargs=1, metavar="PATH", help="Specify the path to a .tar.gz archive that was earlier created with ŠOLEn to restore backed up user data") + parser.add_argument("-b", "--backup", action="store_true", help="back up all user data and store them in a .tar.gz archive") + parser.add_argument("-R", "--backup-restore", action="store", nargs=1, metavar="PATH", help="specify the path to a .tar.gz archive that was previously created with Solen") args = parser.parse_args()