Skip to content

Commit

Permalink
CHANGES: 03
Browse files Browse the repository at this point in the history
  • Loading branch information
FLZ101 committed Sep 8, 2019
1 parent 066fdc8 commit ce412cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* (01) Removes `--email` and `--password`
* (02) Supports downloading "references" of a course
* (03) Checks whether there is a newer version

## 0.1.1

Expand Down
13 changes: 13 additions & 0 deletions dl_coursera_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,20 @@ def download_input_file(dl_tasks, slug, outdir, how):
logging.info('new file: %s' % file_txt)


def get_latest_version():
resp = requests.get('https://pypi.org/pypi/dl-coursera/json')
d = resp.json()

return sorted(d['releases'].keys())[-1]


def main():
latest_version = get_latest_version()
if latest_version != dl_coursera.app_version:
print('dl_coursera version %s is obsolete. ' % dl_coursera.app_version +
'You can upgrade it to version %s via `pip install -U dl_coursera`.' % latest_version)
return

logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(threadName)s - %(message)s')

Expand Down

0 comments on commit ce412cf

Please sign in to comment.