Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed a bug about regex

  • Loading branch information...
commit 697e5486bf85edcaa565b2c79150b1c479a75cdf 1 parent 7c3dc64
@tylerlong authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 everblog/models.py
View
6 everblog/models.py
@@ -37,11 +37,11 @@ def synchronize(self):
dict_ = json.loads(data.replace('\<', '<').replace('\>', '>'))
self.title = dict_['title']
self.content = dict_['content']
- match = img_url_pattern.search(self.content)
- if match:
+ image_urls = img_url_pattern.findall(self.content)
+ if image_urls:
try:
dbm = anydbm.open(app.config['IMAGE_CACHE'], 'c')
- for img_url in match.groups():
+ for img_url in image_urls:
key = Encryption.computer_hashcode(img_url)
value = WebClient.download_binary(img_url)
dbm[key] = value
Please sign in to comment.
Something went wrong with that request. Please try again.