forked from khuxkm/cosmicbot
Minor global var issue fix
This commit is contained in:
parent
ae48ef5c9f
commit
a69878043a
|
@ -1,7 +1,7 @@
|
|||
import plugin, os.path, json, time
|
||||
|
||||
def water(user):
|
||||
try:
|
||||
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"))
|
||||
|
@ -9,7 +9,8 @@ def water(user):
|
|||
json.dump(visitors,f,indent=2)
|
||||
with open(os.path.expanduser("~{}/.botany/{}_plant_data.json".format(user,user))) as f:
|
||||
plant_data = json.load(f)
|
||||
global plant = plant_data['description']
|
||||
global plant
|
||||
plant = plant_data['description']
|
||||
return True # success
|
||||
except:
|
||||
return False # failed
|
||||
|
|
Loading…
Reference in New Issue