Fix indentation
This commit is contained in:
parent
3529f9c5f4
commit
4e726961ed
|
@ -1,14 +1,14 @@
|
|||
import plugin, os.path, json
|
||||
|
||||
def water(user):
|
||||
try:
|
||||
with open(os.path.expanduser("~{}/.botany/visitors.json".format(user))) as f:
|
||||
visitors = json.load(f)
|
||||
visitors.append(dict(timestamp=int(time.time()),user="cosmicbot"))
|
||||
with open(os.path.expanduser("~{}/.botany/visitors.json".format(user)),"w") as f:
|
||||
json.dump(visitors,f,indent=2)
|
||||
try:
|
||||
with open(os.path.expanduser("~{}/.botany/visitors.json".format(user))) as f:
|
||||
visitors = json.load(f)
|
||||
visitors.append(dict(timestamp=int(time.time()),user="cosmicbot"))
|
||||
with open(os.path.expanduser("~{}/.botany/visitors.json".format(user)),"w") as f:
|
||||
json.dump(visitors,f,indent=2)
|
||||
return True # success
|
||||
except:
|
||||
except:
|
||||
return False # failed
|
||||
|
||||
@plugin.command("water")
|
||||
|
|
Loading…
Reference in New Issue