def make_link_from_query(self, fd, query): if not self.url: dbh = DB.DBO(fd.case) dbh.execute("select url from http where inode_id = %r limit 1", fd.inode_id) row = dbh.fetch() self.url = row['url'] or '?' try: self.url = self.url.split('?')[0] except IndexError: pass ## Normalise the url now url = "%s%s" % (self.url, query) return urlnorm.normalize(url)
def make_link(self, url): return urlnorm.normalize(HTML.unquote(url))