UTF-8 is a real thing and we can use it
This commit is contained in:
parent
0376a71d73
commit
5a5bf0f4e2
|
@ -11,7 +11,7 @@ def on_latest(self,channel,nick,count="5"):
|
|||
self.say(channel, "{}: Latest {} {}. (See cosmic.voyage for more!)".format(nick, count, (count == 1 and "entry" or "entries")))
|
||||
else:
|
||||
self.say(channel, "{}: Latest entries matching '{}'. (See cosmic.voyage for more!)".format(nick, count))
|
||||
output = subprocess.check_output(["/usr/local/bin/latest",str(count)]).decode("ascii").split("\n")
|
||||
output = subprocess.check_output(["/usr/local/bin/latest",str(count)]).decode("utf-8").split("\n")
|
||||
output = filter(None,output)
|
||||
for line in output:
|
||||
self.say(channel,"{}: {}".format(nick,line))
|
||||
|
|
|
@ -4,7 +4,7 @@ unhighlight_nick = lambda nick: "_{!s}_".format(nick)
|
|||
|
||||
@plugin.command("roster","<filter>")
|
||||
def on_roster(self,channel,nick,*namecnt):
|
||||
output = subprocess.check_output(["/usr/local/bin/roster",' '.join(namecnt)]).decode("ascii").split("\n")
|
||||
output = subprocess.check_output(["/usr/local/bin/roster",' '.join(namecnt)]).decode("utf-8").split("\n")
|
||||
output = filter(None,output)
|
||||
for line in output:
|
||||
line = re.sub("\s+"," ",line).split(" ",1)
|
||||
|
|
2
utils.py
2
utils.py
|
@ -3,7 +3,7 @@ import plugin, subprocess
|
|||
def register_command_call(command,cli,use_args=False,verify_args=lambda args: args):
|
||||
@plugin.command(command)
|
||||
def on_call(self,channel,nick,*args):
|
||||
output = subprocess.check_output([cli]+list(verify_args(args) if use_args else [])).decode("ascii").split("\n")
|
||||
output = subprocess.check_output([cli]+list(verify_args(args) if use_args else [])).decode("utf-8").split("\n")
|
||||
output = filter(None,output)
|
||||
for line in output:
|
||||
self.say(channel,"{}".format(line))
|
||||
|
|
Loading…
Reference in New Issue