Example #1
0
 def newSearch(self):
     key = self.lineEdit.text()
     group = self.comboBox.currentText()
     result_yield = newSearch(key, group, dbpath=groupDB[group])
     result = ""
     n = 1
     for i in result_yield:
         result += "%d.%s\n" % (n, i)
         n += 1
     self.textBrowser.setText(result)
Example #2
0
 def newSearch(self):
     key = self.lineEdit.text()
     levenshtein = True  # Use accurate searching method as the only option
     result_yield = newSearch(key, self.comboBox.currentText(), levenshtein)
     result = ""
     n = 1
     for i in result_yield:
         result += "%d.%s\n" % (n, i)
         n += 1
     self.textBrowser.setText(result)
Example #3
0
 def newSearch(self):
     key = self.lineEdit.text()
     if python_version().startswith("2"):
         key = unicode(key.toUtf8(), "utf8", "ignore")
     levenshtein = True  # Use accurate searching method as the only option
     result_yield = newSearch(key, self.comboBox.currentText(), levenshtein)
     result = ""
     n = 1
     for i in result_yield:
         result += "%d.%s\n" % (n, i)
         n += 1
     self.textBrowser.setText(result)
Example #4
0
 def newSearch(self):
     key = self.lineEdit.text()
     if python_version().startswith("2"):
         key = unicode(key.toUtf8(), "utf8", "ignore")
     levenshtein = True  # Use accurate searching method as the only option
     result_yield = newSearch(key, self.comboBox.currentText(), levenshtein)
     result = ""
     n = 1
     for i in result_yield:
         result += "%d.%s\n" % (n, i)
         n += 1
     self.textBrowser.setText(result)
Example #5
0
def search(key):
    if python_version().startswith("2"):
        key = unicode(key.toUtf8(), "utf8", "ignore")
    result_yield = newSearch(key, "Saw", True)
    result = ""
    n = 1
    for i in result_yield:
        result += "%d.%s\n" % (n, i)
        n += 1
    if result == "":
        print("Ndi miz.")
    else:
        print(result)
Example #6
0
def search(key):
    if python_version().startswith("2"):
        key = unicode(key.toUtf8(), "utf8", "ignore")
    result_yield = newSearch(key, "Saw", True)
    result = ""
    n = 1
    for i in result_yield:
        result += "%d.%s\n" % (n, i)
        n += 1
    if result == "":
        print("Ndi miz.")
    else:
        print(result)
Example #7
0
    def get(self):
        start = 0
        try:
            start = max(int(self.get_argument("start")), 0)
        except (ValueError, tornado.web.MissingArgumentError):
            pass
        has_count = False
        count = SEARCHING_LIMIT
        try:
            count = max(int(self.get_argument("count")), 1)
            has_count = True
        except (ValueError, tornado.web.MissingArgumentError):
            pass

        new_engine = "on"

        key = ''
        try:
            key = self.get_argument("q")
        except tornado.web.MissingArgumentError:
            new_engine = "on"

        groupList = ["Saw", "Laeh"]
        try:
            group = self.get_argument("group")
            if not group in groupList:
                raise tornado.web.MissingArgumentError
        except tornado.web.MissingArgumentError:
            group = "Saw"
        result_generator = newSearch(key, group, new_engine)
        template_args = {
            "key": key,
            "start": start,
            "count": count,
            "has_count": has_count,
            "result": result_generator,
            "version": info.version,
            "new_engine": new_engine,
            "downloadPageName": DOWNLOADPAGENAME,
            "group": group
        }
        self.render("sawroeg.html", **template_args)
Example #8
0
    def get(self):
        start = 0
        try:
            start = max(int(self.get_argument("start")), 0)
        except (ValueError, tornado.web.MissingArgumentError):
            pass
        has_count = False
        count = SEARCHING_LIMIT
        try:
            count = max(int(self.get_argument("count")), 1)
            has_count = True
        except (ValueError, tornado.web.MissingArgumentError):
            pass

        new_engine = "on"

        key = ''
        try:
            key = self.get_argument("q")
        except tornado.web.MissingArgumentError:
            new_engine = "on"

        groupList = ["Saw", "Laeh"]
        try:
            group = self.get_argument("group")
            if not group in groupList:
                raise tornado.web.MissingArgumentError
        except tornado.web.MissingArgumentError:
            group = "Saw"
        result_generator = newSearch(key, group, new_engine)
        template_args = {
            "key": key, "start": start, "count": count, "has_count": has_count,
            "result": result_generator, "version": info.version,
            "new_engine": new_engine, 
            "downloadPageName": DOWNLOADPAGENAME,
            "group": group
        }
        self.render("sawroeg.html", **template_args)