Created
March 3, 2014 20:30
-
-
Save matael/9333957 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # -*- coding:utf8 -*- | |
| # | |
| # gismu.py | |
| # | |
| # Copyright © 2014 Mathieu Gaborit (matael) <mathieu@matael.org> | |
| # | |
| # | |
| # Distributed under WTFPL terms | |
| # | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # Version 2, December 2004 | |
| # | |
| # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
| # | |
| # Everyone is permitted to copy and distribute verbatim or modified | |
| # copies of this license document, and changing it is allowed as long | |
| # as the name is changed. | |
| # | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
| # | |
| # 0. You just DO WHAT THE FUCK YOU WANT TO. | |
| # | |
| from settings import DBNAME | |
| import sqlite3 | |
| class Gismu: | |
| def __init__(self, gismu): | |
| self.gismu = gismu | |
| _db_lookup() | |
| def _db_lookup(self): | |
| """ Look up through database to find the right definition and references """ | |
| db = sqlite3.connect(DBNAME) | |
| c = db.cursor() | |
| gismu = c.execute("select * from dico where gismu=?", (self.gismu,)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment