def post(self, keywords): keywords = self.request.arguments['terms'][0] DBQ.logTerms(self.request.remote_ip, keywords) commits = DBQ.findByKeywordsAndFulltext(keywords) template = env.get_template('searchresults.html') html = template.render(commits=commits, rsssearchparams=keywords) self.write(html) return
def get(self, keywords): commits = [] if not keywords: template = env.get_template('search.html') else: DBQ.logTerms(self.request.remote_ip, keywords) commits = DBQ.findByKeywordsAndFulltext(keywords) template = env.get_template('searchresults.html') html = template.render(commits=commits, rsssearchparams=keywords) self.write(html) return
def regen(keywords): commits= DBQ.findByKeywords(keywords) for c in commits: c.dbkeywords = c.getSynonyms() c.save() sys.stdout.write(".") sys.stdout.flush() print ""
def regen(keywords): commits = DBQ.findByKeywords(keywords) for c in commits: c.dbkeywords = c.getSynonyms() c.save() sys.stdout.write(".") sys.stdout.flush() print ""
def get(self, keywords): commits = DBQ.findByKeywords(keywords) feed = getFeed() for c in commits: feed.items.append(c.toRSSItem()) self.set_header('Content-Type', 'application/rss+xml') xml = feed.to_xml() self.write(xml) return
def get(self, keywords): fiveDaysAgo = time.time() - (5 * 24 * 60 * 60) commits = DBQ.findByKeywordsAndFulltext(keywords, fiveDaysAgo) feed = getFeed() for c in commits: feed.items.append(c.toRSSItem()) self.set_header('Content-Type', 'application/rss+xml') xml = feed.to_xml() self.write(xml) return
def get(self, project, uniqueid): commit = DBQ.findByIDs(project, uniqueid) if len(commit) > 1: raise "More than one commit returned?" if not commit: self.write("Could not find commit") return commit = commit[0] template = env.get_template('commit.html') html = template.render(commit=commit) self.write(html) return
def get(self, keywords): commits = DBQ.findByKeywords(keywords) feed = RSS2(title="Crypto.is Code Audit Feed", description="Just a thing, right?", link="https://crypto.is", lastBuildDate=datetime.datetime.utcnow()) for c in commits: feed.items.append(c.toRSSItem()) self.set_header('Content-Type', 'application/rss+xml') xml = feed.to_xml() self.write(xml) return
def regen(keywords): commits= DBQ.findByKeywords(keywords) for c in commits: sys.stdout.write("(" + str(c.repo.id) + ":" + c.uniqueid + ":") sys.stdout.flush() diffs = c.getChangedTexts(c.getChangedTextMetadata()) sys.stdout.write("1") sys.stdout.flush() c.dbkeywords = c.getSynonyms(diffs) sys.stdout.write("2") sys.stdout.flush() c.save() sys.stdout.write("3)") sys.stdout.flush() print ""
def get(self, keywords): commits = DBQ.findByKeywords(keywords) feed = RSS2( title = "Crypto.is Code Audit Feed", description = "Just a thing, right?", link = "https://crypto.is", lastBuildDate = datetime.datetime.utcnow() ) for c in commits: feed.items.append(c.toRSSItem()) self.set_header('Content-Type', 'application/rss+xml') xml = feed.to_xml() self.write(xml) return
def regen(keywords): commits = DBQ.findByKeywords(keywords) for c in commits: sys.stdout.write("(" + str(c.repo.id) + ":" + c.uniqueid + ":") sys.stdout.flush() diffs = c.getChangedTexts(c.getChangedTextMetadata()) sys.stdout.write("1") sys.stdout.flush() c.dbkeywords = c.getSynonyms(diffs) sys.stdout.write("2") sys.stdout.flush() c.save() sys.stdout.write("3)") sys.stdout.flush() print ""
def browse(keywords): commits = DBQ.findByKeywords(keywords) for c in commits: print "---------" c.pprint()
def browse(keywords): commits = DBQ.findByKeywordsAndFulltext(keywords) for c in commits: print "=========================================" c.pprint()