diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2014-11-27 14:18:29 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2014-11-27 14:18:29 +0100 |
commit | 0b3c24a6006e712614fa9e33b54e5ff77110d996 (patch) | |
tree | 70eaedbc05198f110c42f452b3b9a499d3dc3920 /imdb-lookup/imdblookup.py | |
parent | f819c8deb9b109b3c30773e5032d7bf58888070b (diff) | |
download | scripts-0b3c24a6006e712614fa9e33b54e5ff77110d996.tar.gz scripts-0b3c24a6006e712614fa9e33b54e5ff77110d996.zip |
windows filenames
Diffstat (limited to 'imdb-lookup/imdblookup.py')
-rwxr-xr-x | imdb-lookup/imdblookup.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |