From f7607f1297b071f019c1522e778978546eb381a4 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 31 Aug 2015 13:10:17 +0200 Subject: Reaktor: update deps --- Reaktor/MANIFEST.in | 1 + Reaktor/Reaktor.nix | 13 +++++++++++-- Reaktor/reaktor/commands/tell-on_join | 3 ++- Reaktor/reaktor/config.py | 13 ++++++++++--- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 Reaktor/MANIFEST.in diff --git a/Reaktor/MANIFEST.in b/Reaktor/MANIFEST.in new file mode 100644 index 00000000..bb3ec5f0 --- /dev/null +++ b/Reaktor/MANIFEST.in @@ -0,0 +1 @@ +include README.md diff --git a/Reaktor/Reaktor.nix b/Reaktor/Reaktor.nix index b804b44a..0f9a2edf 100644 --- a/Reaktor/Reaktor.nix +++ b/Reaktor/Reaktor.nix @@ -1,15 +1,24 @@ with import {}; # nix-build Reaktor.nix # result/bin/reaktor +## or in your env +# nix-env -i -f Reaktor.nix buildPythonPackage rec { name = "Reaktor-${version}"; version = "0.2.6"; - propagatedBuildInputs = with pkgs.pythonPackages;[ + propagatedBuildInputs = with pkgs;[ pythonPackages.docopt + utillinux # for tell_on-join + git ]; src = fetchurl { - url = "https://pypi.python.org/packages/source/R/Reaktor/Reaktor-0.2.6.tar.gz"; + url = "https://pypi.python.org/packages/source/R/Reaktor/Reaktor-${version}.tar.gz"; sha256 = "1dksw1s1n2hxvnga6pygjr174dywncr0wiggkrkn1srbn2amh1c2"; }; + meta = { + homepage = http://krebsco.de/; + description = "An IRC bot based on asynchat"; + license = stdenv.lib.licenses.wtfpl; + }; } diff --git a/Reaktor/reaktor/commands/tell-on_join b/Reaktor/reaktor/commands/tell-on_join index 2dbff41a..bb4982cc 100755 --- a/Reaktor/reaktor/commands/tell-on_join +++ b/Reaktor/reaktor/commands/tell-on_join @@ -1,13 +1,14 @@ #! /bin/sh set -euf -# require flock from util-linux +# require flock from util-linux (pkgs.utillinux) if test "${FLOCK-}" != "$state_file"; then exec env FLOCK="$state_file" flock "$state_file" "$0" "$@" fi to="$_from" +test -e "$state_file" || touch "$state_file" # print messages sed -n '/^'"$to"' /{ s/^\([^ ]\+\) \([^ ]\+\) <\([^>]\+\)> \(.*\)/\1: \4 2-- \2, \3/p diff --git a/Reaktor/reaktor/config.py b/Reaktor/reaktor/config.py index 73daa81f..85824321 100644 --- a/Reaktor/reaktor/config.py +++ b/Reaktor/reaktor/config.py @@ -10,8 +10,15 @@ debug = True name = os.environ.get('IRC_NICKNAME','crabmanner') -#workdir = expanduser('~') + '/state' -workdir = './state' +#workdir = './state' +workdir = expanduser('~') + '/state' + +# TODO: YAY more functionality in config.py .. +# if this fails the bot will fail (which is ok) +if not os.path.isdir(workdir): os.makedirs(workdir) + + + irc_alarm_timeout = 300 irc_hammer_interval = 10 @@ -36,7 +43,7 @@ config_filename = abspath(__file__) mod_dir=dirname(abspath(reaktor.__file__)) # the commands dirname ( -dist_dir = abspath(join(mod_dir,"..")) +dist_dir = abspath(join(mod_dir)) # me is used, so name cannot kill our patterns below -- cgit v1.2.3