Separate toggler from checker
This commit is contained in:
parent
43850de706
commit
3cb5d8861c
1 changed files with 7 additions and 4 deletions
|
@ -85,11 +85,8 @@ class dbObject:
|
|||
except:
|
||||
return False
|
||||
|
||||
def toggleTweet(self, cid):
|
||||
def getTStatus(self, cid):
|
||||
try:
|
||||
self.executeQuery("UPDATE tokens SET tweet = NOT tweet WHERE cid = %i;" % int(cid))
|
||||
self.commit()
|
||||
|
||||
self.executeQuery("SELECT tweet FROM tokens WHERE cid = %i;" % int(cid))
|
||||
|
||||
return True if self.cur.fetchone()[0] == 1 else False
|
||||
|
@ -97,6 +94,12 @@ class dbObject:
|
|||
except:
|
||||
raise ValueError("No such user: %i" % int(cid))
|
||||
|
||||
def toggleTweet(self, cid):
|
||||
self.executeQuery("UPDATE tokens SET tweet = NOT tweet WHERE cid = %i;" % int(cid))
|
||||
self.commit()
|
||||
|
||||
return getTStatus
|
||||
|
||||
def addFish(self, cid):
|
||||
self.executeQuery("UPDATE tokens SET fish = fish + 1 WHERE cid = %i;" % int(cid))
|
||||
self.commit()
|
||||
|
|
Loading…
Reference in a new issue