Viperinius / ILIAS-Sync2Folder-CLI

Command line version of ILIAS-Sync2Folder
MIT License
2 stars 1 forks source link

'NoneType' object is not subscriptable on sync #1

Open daniel-vera-g opened 4 years ago

daniel-vera-g commented 4 years ago

Hey first of all very interesting project!

I changed the settings in the config.yaml to be able to use it for the ilias of my university. I managed to successfully login, but by trying to sync throws:

'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/home/env/lib/python3.6/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/env/lib/python3.6/site-packages/cliff/command.py", line 187, in run
    return_code = self.take_action(parsed_args) or 0
  File "/home/env/ILIAS-Sync2Folder-CLI/sync2folder/commands.py", line 205, in take_action
    sync2folder.sync.startSync(parsed_args, self.app.stdout)
  File "/home/env/ILIAS-Sync2Folder-CLI/sync2folder/sync.py", line 76, in startSync
    generateCourseList()
  File "/home/env/ILIAS-Sync2Folder-CLI/sync2folder/sync.py", line 141, in generateCourseList
    rawCourses = handler.getCourseNames()
  File "/home/env/ILIAS-Sync2Folder-CLI/sync2folder/ilias/iliasHandling.py", line 153, in getCourseNames
    course.courseName = self.getCourseName(course.courseId)
  File "/home/env/ILIAS-Sync2Folder-CLI/sync2folder/ilias/iliasHandling.py", line 162, in getCourseName
    return xmlCourse['Objects']['Object']['Title']
TypeError: 'NoneType' object is not subscriptable

Did not have the time to take a closer look at the code/issue, but maybe you know the reason or some quick fix :)

Viperinius commented 4 years ago

Hi, thanks for trying it out :)

On first sight, this looks as if the xml layout returned from ILIAS has changed since I last worked with it. Or at least doesn't fit the expected form. The tool expects something along the lines of:

<Objects>
  <Object>
    <Title>Bla</Title>
    <Description/>
    <Owner>1234</Owner>
    ...
  </Object>
</Objects

I no longer have access to ILIAS, so I can't really test any more myself. Feel free to post any "debug print outputs" or further questions!

daniel-vera-g commented 4 years ago

Ok, thanks for your reply :+1: Will look into once I've some time left.