From 0b3c24a6006e712614fa9e33b54e5ff77110d996 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Thu, 27 Nov 2014 14:18:29 +0100 Subject: windows filenames --- imdb-lookup/imdblookup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'imdb-lookup/imdblookup.py') diff --git a/imdb-lookup/imdblookup.py b/imdb-lookup/imdblookup.py index f6d7ff5..788350c 100755 --- a/imdb-lookup/imdblookup.py +++ b/imdb-lookup/imdblookup.py @@ -54,7 +54,7 @@ def read_filename(filename): return name.replace(u".", u" ") def write_filename(filename): - return re.sub(u"[^a-zA-Z123 ]", u"_", filename) + return re.sub(u"[^a-zA-Z0-9()\- _#]", u"_", filename) class FocusableFrame(urwid.Frame): def keypress(self, size, key): @@ -126,7 +126,7 @@ class UI(urwid.WidgetWrap): info = self.search_service.info(movie_id) alt_titles = self.search_service.alternative_titles(movie_id)["titles"] info["year"] = info["release_date"].split("-")[0] - info["filename"] = u"{title} ({year}) #{imdb_id}".format(**info) + info["filename"] = write_filename(u"{title} ({year}) #{imdb_id}".format(**info)) btn = urwid.Button(("fetched", u"{title} ({year}) #{imdb_id}".format(**info))) urwid.connect_signal(btn, "click", self.rename, info) self.model.insert(pos+1, btn) -- cgit v1.2.1