summaryrefslogtreecommitdiff
path: root/imdb-lookup/imdblookup.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2014-11-27 14:18:29 +0100
committerYves Fischer <yvesf-git@xapek.org>2014-11-27 14:18:29 +0100
commit0b3c24a6006e712614fa9e33b54e5ff77110d996 (patch)
tree70eaedbc05198f110c42f452b3b9a499d3dc3920 /imdb-lookup/imdblookup.py
parentf819c8deb9b109b3c30773e5032d7bf58888070b (diff)
downloadscripts-0b3c24a6006e712614fa9e33b54e5ff77110d996.tar.gz
scripts-0b3c24a6006e712614fa9e33b54e5ff77110d996.zip
windows filenames
Diffstat (limited to 'imdb-lookup/imdblookup.py')
-rwxr-xr-ximdb-lookup/imdblookup.py4
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)