diff options
author | makefu <github@syntax-fehler.de> | 2020-08-15 14:15:10 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2020-08-15 14:15:39 +0200 |
commit | 6ca24980fd9aef34ace440ec683eed81a22ca6a8 (patch) | |
tree | 4f9745212acfbac85dd744b17fa01276577a9088 /nix | |
parent | 797f2e07d27a3ebd03cc2f0ee22c5c79da06b6d1 (diff) |
release version
Diffstat (limited to 'nix')
-rw-r--r-- | nix/matrixbot.patch | 12 | ||||
-rw-r--r-- | nix/python-matrixbot.nix | 31 | ||||
-rw-r--r-- | nix/translate.patch | 17 |
3 files changed, 60 insertions, 0 deletions
diff --git a/nix/matrixbot.patch b/nix/matrixbot.patch new file mode 100644 index 0000000..2b9bbbe --- /dev/null +++ b/nix/matrixbot.patch @@ -0,0 +1,12 @@ +diff --git a/matrixbot/matrixbot.py b/matrixbot/matrixbot.py +index 8e5598c..d8c23d2 100644 +--- a/matrixbot/matrixbot.py ++++ b/matrixbot/matrixbot.py +@@ -51,7 +51,6 @@ class MatrixBot: + self.user = None + if self.token is not None and self.user_id is not None: + self.user = self.client.get_user(self.user_id) +- self.user.set_display_name(self.display_name) + self.init_rooms(self.client.rooms) + self.invite_listener = self.client.add_invite_listener(self.handle_invite) + self.cache = Cache(dbfile=cache_db) diff --git a/nix/python-matrixbot.nix b/nix/python-matrixbot.nix new file mode 100644 index 0000000..7bc5aa7 --- /dev/null +++ b/nix/python-matrixbot.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchPypi +, markdown +, matrix-client +}: + +buildPythonPackage rec { + pname = "python-matrixbot"; + version = "0.0.7"; + CI_COMMIT_TAG = version; + + #src = ./python-matrixbot; + src = fetchPypi { + inherit pname version; + sha256 = "9412981b14ff3ab7ffbb1bfc1691758113ab8d71f731b3093d8808c286b69c71"; + }; + patches = [ ./matrixbot.patch ]; + + propagatedBuildInputs = [ + markdown + matrix-client + ]; + + meta = with lib; { + description = "A basic bot for Matrix"; + homepage = https://gitlab.com/gibberfish/python-matrixbot; + license = licenses.mit; + # maintainers = [ maintainers. ]; + }; +} diff --git a/nix/translate.patch b/nix/translate.patch new file mode 100644 index 0000000..6ff8207 --- /dev/null +++ b/nix/translate.patch @@ -0,0 +1,17 @@ +diff --git a/googletrans/client.py b/googletrans/client.py +index 89c2237..c203b44 100644 +--- a/googletrans/client.py ++++ b/googletrans/client.py +@@ -190,6 +190,13 @@ class Translator(object): + pass + if not PY3 and isinstance(pron, unicode) and isinstance(origin, str): # pragma: nocover + origin = origin.decode('utf-8') ++ ++ if pron is None: ++ try: ++ pron = data[0][2][2] ++ except: # pragma: nocover ++ pass ++ + if dest in EXCLUDES and pron == origin: + pron = translated |