def loadSTR(str,lang): Hypertable=HypertableConnection() str = base64.b64encode(str) results=Hypertable.query("SELECT txt:'"+ lang +"' FROM TRANSLATIONS WHERE ROW='" + str + "' CELL_LIMIT 1") if len(results.cells) > 0: return base64.b64decode(results.cells[0].value) return False
def getCountry(): ip = web.ctx.env.get('REMOTE_ADDR') Hypertable=HypertableConnection() results=Hypertable.query("SELECT G FROM TEMP WHERE ROW='" + ip + "' CELL_LIMIT 1") if len(results.cells) > 0: return results.cells[0].value country = getCountryFromIP(ip) storeGeoip(ip,country) return country
def deleteSTR(str,lang): Hypertable=HypertableConnection() str = base64.b64encode(str) Hypertable.query("DELETE txt:'"+ lang +"' FROM TRANSLATIONS WHERE ROW='" + str + "'")