From 9661fa0e6ae5206a038397700a2656acfa78ca2c Mon Sep 17 00:00:00 2001 From: Leonardo Date: Fri, 25 Jun 2010 15:00:18 +0200 Subject: [PATCH] Workaround for mldonkey directories. --- mlmanager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mlmanager.py b/mlmanager.py index 8460e16..7314066 100644 --- a/mlmanager.py +++ b/mlmanager.py @@ -185,6 +185,12 @@ class Download(): self._dest_path = os.path.join(os.getenv("HOME"), self._incoming) self._dest_path = os.path.join(self._dest_path, self._filename) + # It seems that mldonkey can confuse about directory and files. + if not os.path.exists(self._dest_path) and "directories" in self._dest_path: + self._dest_path = self._dest_path.replace("directories", "files") + if not os.path.exists(self._dest_path) and "files" in self._dest_path: + self._dest_path = self._dest_path.replace("files", "directories") + # If we get called with a non-existant file as argument that # is really a problem. if not os.path.exists(self._dest_path): -- 2.1.4