Hanse00 / LecToCal

Synchronising Lectio schedules into Google Calendar.
Apache License 2.0
5 stars 6 forks source link

Need help #15

Closed ManasKatyal closed 6 years ago

ManasKatyal commented 6 years ago

Hi Hanse.

I keep getting the error.

usage: lectocal.run [-h] [--credentials CREDENTIALS] [--calendar CALENDAR] [--weeks WEEKS] school_id {student,teacher} user_id lectocal.run: error: too few arguments

And I have tried almost anything. Do you have any fix for me?

Hanse00 commented 6 years ago

To be clear, what exactly is the command you are running when you get this message?

Are you supplying the required parameters, school_id student or teacher and user_id?

Such as: lectocal.run 123 student 321233

ManasKatyal commented 6 years ago

Hi again. I came though that point. Now after I have entered lectocal.run I get this message.

manas$ python -m lectocal.run 484 student 22838092523 Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/Library/Python/2.7/site-packages/lectocal/run.py", line 71, in main() File "/Library/Python/2.7/site-packages/lectocal/run.py", line 60, in main arguments.weeks) File "/Library/Python/2.7/site-packages/lectocal/lectio.py", line 258, in get_schedule return _retreive_user_schedule(school_id, user_type, user_id, n_weeks) File "/Library/Python/2.7/site-packages/lectocal/lectio.py", line 242, in _retreive_user_schedule week) File "/Library/Python/2.7/site-packages/lectocal/lectio.py", line 223, in _retreive_week_schedule schedule = _parse_page_to_lessons(r.content) File "/Library/Python/2.7/site-packages/lectocal/lectio.py", line 217, in _parse_page_to_lessons lessons.append(_parse_element_to_lesson(element)) File "/Library/Python/2.7/site-packages/lectocal/lectio.py", line 206, in _parse_element_to_lesson return lesson.Lesson(id, summary, status, start_time, end_time, location, description, link) File "/Library/Python/2.7/site-packages/lectocal/lesson.py", line 33, in init self.id = self._gen_id() File "/Library/Python/2.7/site-packages/lectocal/lesson.py", line 78, in _gen_id hasher.update(bytes(lesson_string, "utf8")) TypeError: str() takes at most 1 argument (2 given)

Hanse00 commented 6 years ago

Looks like the problem is that you are using Python 2.7 (File "/Library/Python/2.7/site-packages/lectocal/lesson.py" in your output).

Lectocal only supports Python 3 and above. You can install it from https://www.python.org.

Feel free to reach back out if you still have issues after using a newer version of Python.