Use the relative import syntax

This also means that the script has to be run as a package. Hence, we
replace the coursers-dl symlink with a executable script that uses
coursera_dl.main.
This commit is contained in:
Jonas De Taeye 2013-07-13 12:45:52 +02:00
parent 0560648eed
commit ae96f0fa6d
3 changed files with 13 additions and 8 deletions

View file

@ -1 +0,0 @@
coursera/coursera_dl.py

6
coursera-dl Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from coursera import coursera_dl
coursera_dl.main()

View file

@ -11,8 +11,8 @@ import StringIO
import requests
from define import AUTH_URL, CLASS_URL, AUTH_REDIRECT_URL, PATH_COOKIES
from utils import mkdir_p
from .define import AUTH_URL, CLASS_URL, AUTH_REDIRECT_URL, PATH_COOKIES
from .utils import mkdir_p
# Monkey patch cookielib.Cookie.__init__.

View file

@ -63,13 +63,13 @@ except ImportError:
BeautifulSoup = lambda page: BeautifulSoup_(page, 'html.parser')
from cookies import (
from .cookies import (
AuthenticationFailed, ClassNotFound,
get_cookies_for_class, make_cookie_values)
from credentials import get_credentials, CredentialsError
from define import CLASS_URL, ABOUT_URL
from downloaders import get_downloader
from utils import clean_filename, get_anchor_format, mkdir_p, fix_url
from .credentials import get_credentials, CredentialsError
from .define import CLASS_URL, ABOUT_URL
from .downloaders import get_downloader
from .utils import clean_filename, get_anchor_format, mkdir_p, fix_url
def get_syllabus_url(class_name, preview):