utils/page.py
def load_from_json(self, json_obj):
        """
        Don't load the json object if it is not valid (e.g., too large or lacking of title)
        """
        """
        if json_obj['url'] == "http://www.armslist.com/classifieds/knoxville-tennessee":
            print json_obj
            print self.is_valid(json_obj)
            print json_obj['text']
        """
        if not json_obj:
            print "Warning: json object is empty"
            return
    
        if 'html' in json_obj:
            if self.is_valid(json_obj):
                self.html = json_obj['html']
                if 'text' in json_obj:
                    self.body = json_obj['text']
        else:
            print 'html is empty'

        Don't load the json object if it is not valid (e.g., too large or lacking of title)
        
Don't load the json object if it is not valid
Don ' t load the json object if it is not valid
def load_from_json(self, json_obj):
        if not json_obj:
            print "Warning: json object is empty"
            return
        if 'html' in json_obj:
            if self.is_valid(json_obj):
                self.html = json_obj['html']
                if 'text' in json_obj:
                    self.body = json_obj['text']
        else:
            print 'html is empty'
def load_from_json ( self , json_obj ) : """
        if json_obj['url'] == "http://www.armslist.com/classifieds/knoxville-tennessee":
            print json_obj
            print self.is_valid(json_obj)
            print json_obj['text']
        """ if not json_obj : print "Warning: json object is empty" return if 'html' in json_obj : if self . is_valid ( json_obj ) : self . html = json_obj [ 'html' ] if 'text' in json_obj : self . body = json_obj [ 'text' ] else : print 'html is empty'
Don't load the json object if it is not valid (e.g., too large or lacking of title)
Don ' t load the json object if it is not valid ( e . g . too large or lacking of title )
"""
        Don't load the json object if it is not valid (e.g., too large or lacking of title)
        """ """
        if json_obj['url'] == "http://www.armslist.com/classifieds/knoxville-tennessee":
            print json_obj
            print self.is_valid(json_obj)
            print json_obj['text']
        """
self
json_obj