Ejemplo n.º 1
0
 def parseOnSearchName(self, keyword):
     self.cleanup()
     keyword = keyword.lower()
     for key in _KEYWORDS_LIST:
         if keyword in key.lower():
             win = self.makePanel(key)
             self.AddPage(win, key)
     self.setStyle()
     self.getPage("Intro")
     wx.CallAfter(self.AdjustSize)
Ejemplo n.º 2
0
 def parseOnSearchName(self, keyword):
     self.cleanup()
     keyword = keyword.lower()
     for key in self.directories:
         for key2 in self.files[key]:
             if keyword in key2.lower():
                 win = self.makePanel(os.path.join(self.root, key, key2))
                 self.AddPage(win, key2)
     self.setStyle()
     wx.CallAfter(self.AdjustSize)
Ejemplo n.º 3
0
 def parseOnSearchPage(self, keyword):
     self.cleanup()
     keyword = keyword.lower()
     for key in _KEYWORDS_LIST:
         with open(os.path.join(DOC_PATH, key), "r") as f:
             text = f.read().lower()
             if keyword in text:
                 win = self.makePanel(key)
                 self.AddPage(win, key)
     self.setStyle()
     self.getPage("Intro")
     wx.CallAfter(self.AdjustSize)
Ejemplo n.º 4
0
def complete_words_from_str(text, keyword):
    words = [keyword]
    keyword = keyword.lower()
    text_ori = text
    text = text.replace("`", " ").replace("'", " ").replace(".", " ").replace(", ", " ").replace('"', " ").replace("=", " ").replace("\n", " ").lower()
    found = text.find(keyword)
    while found > -1:
        start = text.rfind(" ", 0, found)
        end = text.find(" ", found)
        words.append(text_ori[start:end])
        found = text.find(keyword, found + 1)
    words = " ".join(words)
    return words
Ejemplo n.º 5
0
 def parseOnSearchPage(self, keyword):
     self.cleanup()
     keyword = keyword.lower()
     for key in self.directories:
         for key2 in self.files[key]:
             with open(os.path.join(self.root, key, key2), "r") as f:
                 text = f.read().lower()
                 first = text.find('"""')
                 if first != -1:
                     newline = text.find("\n", first)
                     second = text.find('"""', newline)
                     text = text[newline + 1:second]
                 else:
                     text = "module not documented..."
                 if keyword in text:
                     win = self.makePanel(os.path.join(self.root, key, key2))
                     self.AddPage(win, key2)
     self.setStyle()
     wx.CallAfter(self.AdjustSize)