[gsoc-admin] get_main_data_from_section: Implement downloading



commit 6e8e31c2998e34bfa8cfaf377bcff9cc4281a4fe
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date:   Wed Aug 12 14:29:12 2015 +0200

    get_main_data_from_section: Implement downloading

 email/config.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/email/config.py b/email/config.py
index 2703a79..02ca9c6 100644
--- a/email/config.py
+++ b/email/config.py
@@ -5,6 +5,7 @@ import datetime
 import csv
 from ics import Calendar
 import re
+from urllib import request
 
 
 def apply_substitutions(uri):
@@ -26,8 +27,7 @@ def get_main_data_from_section(section):
     assert ('url' in section) != ('path' in section)
     if 'url' in section:
         source = apply_substitutions(section['url'])
-
-        raise NotImplementedError
+        return request.urlopen(source).read()
     else:
         source = apply_substitutions(section['path'])
         with open(source) as file:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]