From 3c6abfda4134079b52e41b8cc4bf20b15a6f6c2f Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 14 Oct 2014 22:09:26 +0200 Subject: mkdir before move --- imdb-lookup/imdblookup.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'imdb-lookup') diff --git a/imdb-lookup/imdblookup.py b/imdb-lookup/imdblookup.py index 9655ce6..f6d7ff5 100755 --- a/imdb-lookup/imdblookup.py +++ b/imdb-lookup/imdblookup.py @@ -153,6 +153,8 @@ class UI(urwid.WidgetWrap): def rename(*_): urwid.disconnect_signal(self.btn_apply, u"click", rename) try: + if not os.path.exists(info["filename"]): + os.mkdir(info["filename"]) shutil.move(self.filename, info["filename"]) except Exception as e: self.view.set_focus("header") -- cgit v1.2.1