diff options
Diffstat (limited to 'lib/plugins/txt/markov_py_markovify.ex')
-rw-r--r-- | lib/plugins/txt/markov_py_markovify.ex | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/plugins/txt/markov_py_markovify.ex b/lib/plugins/txt/markov_py_markovify.ex index f79ed47..47ff0a7 100644 --- a/lib/plugins/txt/markov_py_markovify.ex +++ b/lib/plugins/txt/markov_py_markovify.ex @@ -1,5 +1,4 @@ defmodule Nola.Plugins.Txt.MarkovPyMarkovify do - def start_link() do {:ok, nil} end @@ -19,7 +18,8 @@ defmodule Nola.Plugins.Txt.MarkovPyMarkovify do defp run(args \\ []) do {binary, script} = script() args = [script, Path.expand(Nola.Plugins.Txt.directory()) | args] - IO.puts "Args #{inspect args}" + IO.puts("Args #{inspect(args)}") + case MuonTrap.cmd(binary, args) do {response, 0} -> response {response, code} -> "error #{code}: #{response}" @@ -28,12 +28,11 @@ defmodule Nola.Plugins.Txt.MarkovPyMarkovify do defp script() do default_script = to_string(:code.priv_dir(:nola)) <> "/irc/txt/markovify.py" - env = Application.get_env(:nola, Nola.Plugins.Txt, []) - |> Keyword.get(:py_markovify, []) + + env = + Application.get_env(:nola, Nola.Plugins.Txt, []) + |> Keyword.get(:py_markovify, []) {Keyword.get(env, :python, "python3"), Keyword.get(env, :script, default_script)} end - - - end |