Add logging and fix toot command error

This commit is contained in:
Robert Miles 2018-11-21 12:14:19 -05:00
parent 7dedbd4f66
commit 498eb52fc3
1 changed files with 2 additions and 1 deletions

3
bot.py
View File

@ -15,7 +15,8 @@ def log(s):
f.write(s.rstrip()+"\n")
def toot(s,tootjson="/usr/local/bin"):
return subprocess.call(["/usr/local/bin/toot",s],env={"TOOT_JSON_PATH":tootjson})
with open(os.path.expanduser("~/minerbot2.log"),"a") as f:
return subprocess.call(["/usr/local/bin/toot",s],env={"TOOT_JSON_PATH":tootjson,"LANG":"C.UTF-8","LC_ALL":"C.UTF-8"},stdout=f,stderr=subprocess.STDOUT)
gttapi = gitea.GiteaAPI("https://tildegit.org")
#ghapi = github.GithubAPI()