Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

            @staticmethod
    def from_url(course_url):
        try:
            req = urllib2.Request(course_url)
            response = urllib2.urlopen(req)
        except urllib2.HTTPError, he:
            raise ChisubmitException("Error when accessing %s: %s %s" % (course_url, he.code, he.msg), he)
        except urllib2.URLError, ue:
            raise ChisubmitException("Error when accessing %s: %s" % (course_url, ue.reason), ue)
        
        course = yaml.load(response)
        if type(course) != Course:
            raise ChisubmitModelException("Course file does not contain a Course object.")        
        
        return course
        


src/c/h/chisubmit-0.1.1/src/chisubmit/cli/course.py   chisubmit(Download)
def cli_do__course_install(course, args):
    if args.filename.startswith("http"):
        new_course = Course.from_url(args.filename)
    else:
        f = open(args.filename)