def get_node (self, url_data):
        """Return new node data or None if node already exists."""
        if not url_data.url:
            return None
        elif url_data.url in self.nodes:
            return None
        node = {
            "url": url_data.url,
            "parent_url": url_data.parent_url,
            "id": self.nodeid,
            "label": quote(url_data.title if url_data.title else url_data.name),
            "extern": 1 if url_data.extern else 0,
            "checktime": url_data.checktime,
            "size": url_data.size,
            "dltime": url_data.dltime,
            "edge": quote(url_data.name),
            "valid": 1 if url_data.valid else 0,
        }
        self.nodes[node["url"]] = node
        self.nodeid += 1
        return node
def get_node ( self , url_data ) : if not url_data . url : return None elif url_data . url in self . nodes : return None node = { "url" : url_data . url , "parent_url" : url_data . parent_url , "id" : self . nodeid , "label" : quote ( url_data . title if url_data . title else url_data . name ) , "extern" : 1 if url_data . extern else 0 , "checktime" : url_data . checktime , "size" : url_data . size , "dltime" : url_data . dltime , "edge" : quote ( url_data . name ) , "valid" : 1 if url_data . valid else 0 , } self . nodes [ node [ "url" ] ] = node self . nodeid += 1 return node
Return new node data or None if node already exists.