sholiday / desire2download

Download all of the content from the University of Waterloo's Desire2Learn LMS
http://stephenholiday.com/desire2download/
Apache License 2.0
29 stars 23 forks source link

Forward slash in course names #6

Closed esdu closed 12 years ago

esdu commented 12 years ago

I have a class named "AFM 131/ARBUS 101", the forward slash is being replaced here, which results in a folder named AFM 131\ being created, inside that is ARBUS 101 - Fall 2012, and inside that are all the files.

I'm not sure what's a good way to deal with this. I don't think it's possible to create a folder with a / in the name in unix. Maybe x.replace('/', ', ')?

KartikTalwar commented 12 years ago

Hello @carnival,

Does adding this one line before line 194 fix your issue?

        else:
            _path[0] =  _path[0].replace('/', '-')  # new
            path = '/'.join(map(lambda x: x.replace('/', '\/'), _path))
            self.download_file(root['name'], root['url'], path)

This isn't a proper fix for your problem but I'm trying to narrow it down here.

Let me know

esdu commented 12 years ago

Hey KartikTalwar, sure, that fixes it. I agree we should replace the / with something, and I think what you have is good enough of a fix. Just curious, is replacing / with - a convention?

KartikTalwar commented 12 years ago

Well... sort of/not really. Just one of the commonly used separator. Could have gone with a comma too but you rarely see folder names that include commas. A period or a space would have worked as well.