/Moon language fixed
This commit is contained in:
parent
8bcdcb88fe
commit
413f23bec3
1 changed files with 4 additions and 4 deletions
|
|
@ -22,6 +22,9 @@ def get_moon(parsed_query):
|
||||||
location = location[:location.index('@')]
|
location = location[:location.index('@')]
|
||||||
|
|
||||||
cmd = [globals.PYPHOON]
|
cmd = [globals.PYPHOON]
|
||||||
|
if lang:
|
||||||
|
cmd += ["-l", lang]
|
||||||
|
|
||||||
if date:
|
if date:
|
||||||
try:
|
try:
|
||||||
dateutil.parser.parse(date)
|
dateutil.parser.parse(date)
|
||||||
|
|
@ -30,10 +33,7 @@ def get_moon(parsed_query):
|
||||||
else:
|
else:
|
||||||
cmd += [date]
|
cmd += [date]
|
||||||
|
|
||||||
env = os.environ.copy()
|
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
||||||
if lang:
|
|
||||||
env['LANG'] = lang
|
|
||||||
p = Popen(cmd, stdout=PIPE, stderr=PIPE, env=env)
|
|
||||||
stdout = p.communicate()[0]
|
stdout = p.communicate()[0]
|
||||||
stdout = stdout.decode("utf-8")
|
stdout = stdout.decode("utf-8")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue