def search(kanji): init_db(paths['kanjidic']) # todo: fix this ugliness kanji = unicode(unicode(kanji).encode('utf-8'), 'utf-8') found = JDIC.query.filter_by(literal=kanji).first() restore() return found
def search(kanji): init_db(paths["kanjidic"]) # todo: fix this ugliness kanji = unicode(unicode(kanji).encode("utf-8"), "utf-8") found = JDIC.query.filter_by(literal=kanji).first() restore() return found
def main(): app = QApplication(sys.argv) # Initialize db init_db() # Create UI instance gui = GUI() # Get new kanji from db gui.get_all() # Display dialog gui.show() sys.exit(app.exec_())
def create_freq_db(file_path): """ Create or initialize specified DB file. """ init_db(file_path)