[totem] iplayer: Remove spurious whitespace added in regular expresssions
- From: Sjoerd Simons <sjoerds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] iplayer: Remove spurious whitespace added in regular expresssions
- Date: Sun, 6 Nov 2011 11:33:40 +0000 (UTC)
commit b15d0fdc7b8f7042b5fa27593321607946f06d7d
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date: Sun Nov 6 11:07:55 2011 +0000
iplayer: Remove spurious whitespace added in regular expresssions
(helps: #663495)
src/plugins/iplayer/iplayer2.py | 4 ++--
src/plugins/iplayer/listparser.py | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/iplayer/iplayer2.py b/src/plugins/iplayer/iplayer2.py
index 5b71e69..61b93a3 100644
--- a/src/plugins/iplayer/iplayer2.py
+++ b/src/plugins/iplayer/iplayer2.py
@@ -303,7 +303,7 @@ def httpget (url):
def parse_entry_id (entry_id):
# tag:bbc.co.uk,2008:PIPS:b00808sc
- regexp = re.compile ('PIPS: ([0-9a-z]{8})')
+ regexp = re.compile ('PIPS:([0-9a-z]{8})')
matches = regexp.findall (entry_id)
if not matches:
return None
@@ -994,7 +994,7 @@ class Feed (object):
# quick and dirty category extraction and count
xml_url = self.__create_url ('list')
xml = httpget (xml_url)
- cat = re.findall ("<category .*term=\" (.*?)\"", xml)
+ cat = re.findall ("<category .*term=\"(.*?)\"", xml)
categories = {}
for category in cat:
if category != 'TV':
diff --git a/src/plugins/iplayer/listparser.py b/src/plugins/iplayer/listparser.py
index eac01b7..80a5de8 100644
--- a/src/plugins/iplayer/listparser.py
+++ b/src/plugins/iplayer/listparser.py
@@ -32,20 +32,20 @@ def parse (xml_source):
elist = ListEntries ()
# gather all list entries
- entries_src = re.findall ("<entry> (.*?)</entry>", xml_source, re.DOTALL)
+ entries_src = re.findall ("<entry>(.*?)</entry>", xml_source, re.DOTALL)
datematch = re.compile (':\s+ ([0-9]+)/ ([0-9]+)/ ([0-9]{4})')
# enumerate thru the element list and gather info
for entry_src in entries_src:
- title = re.findall ("<title[^>]*> (.*?)</title>",
+ title = re.findall ("<title[^>]*>(.*?)</title>",
entry_src, re.DOTALL)[0]
- identifier = re.findall ("<id[^>]*> (.*?)</id>",
+ identifier = re.findall ("<id[^>]*>(.*?)</id>",
entry_src, re.DOTALL)[0]
- updated = re.findall ("<updated[^>]*> (.*?)</updated>",
+ updated = re.findall ("<updated[^>]*>(.*?)</updated>",
entry_src, re.DOTALL)[0]
- summary = re.findall ("<content[^>]*> (.*?)</content>",
+ summary = re.findall ("<content[^>]*>(.*?)</content>",
entry_src, re.DOTALL)[0].splitlines ()[-3]
- categories = re.findall ("<category[^>]*term=\" (.*?)\"[^>]*>",
+ categories = re.findall ("<category[^>]*term=\"(.*?)\"[^>]*>",
entry_src, re.DOTALL)
match = datematch.search (title)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]