mirror of
https://github.com/chubin/wttr.in
synced 2024-11-15 16:38:06 +00:00
/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('@')]
|
||||
|
||||
cmd = [globals.PYPHOON]
|
||||
if lang:
|
||||
cmd += ["-l", lang]
|
||||
|
||||
if date:
|
||||
try:
|
||||
dateutil.parser.parse(date)
|
||||
|
@ -30,10 +33,7 @@ def get_moon(parsed_query):
|
|||
else:
|
||||
cmd += [date]
|
||||
|
||||
env = os.environ.copy()
|
||||
if lang:
|
||||
env['LANG'] = lang
|
||||
p = Popen(cmd, stdout=PIPE, stderr=PIPE, env=env)
|
||||
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
||||
stdout = p.communicate()[0]
|
||||
stdout = stdout.decode("utf-8")
|
||||
|
||||
|
|
Loading…
Reference in a new issue