Skip to content

Commit

Permalink
Change the backslash with a -
Browse files Browse the repository at this point in the history
  • Loading branch information
Kcchouette authored Jan 14, 2017
1 parent 0e3b2fc commit 0c02644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crunchy-xml-decoder/ultimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def ultimate(page_url, seasonnum, epnum):
# title = h.unescape(unidecode(title)).replace('/', ' - ').replace(':', '-').
# replace('?', '.').replace('"', "''").replace('|', '-').replace('"',"''").strip()

### Taken from http://stackoverflow.com/questions/6116978/python-replace-multiple-strings ###
rep = {' / ': ' - ', '/': ' - ', ':': '-', '?': '.', '"': "''", '|': '-', '"': "''", 'a*G':'a G', '*': '#', u'\u2026': '...'}
### Taken from http://stackoverflow.com/questions/6116978/python-replace-multiple-strings and imrpoved to include the backslash###
rep = {' / ': ' - ', '/': ' - ', ':': '-', '?': '.', '"': "''", '|': '-', '"': "''", 'a*G':'a G', '*': '#', u'\u2026': '...', ' \ ': ' - '}

rep = dict((re.escape(k), v) for k, v in rep.iteritems())
pattern = re.compile("|".join(rep.keys()))
Expand Down

0 comments on commit 0c02644

Please sign in to comment.