summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun SAG <sagarun@gmail.com>2011-09-24 20:30:46 +0530
committerArun SAG <sagarun@gmail.com>2011-09-24 20:30:46 +0530
commit10ff7a37e1403f96f73918b6b30a51da1f56a654 (patch)
treea5256e50055097f03002a178ba78d32dee355b6e
parent85ceec244562920040823b748af1a18409f6c69e (diff)
downloadaskbot-10ff7a37e1403f96f73918b6b30a51da1f56a654.tar.gz
askbot-10ff7a37e1403f96f73918b6b30a51da1f56a654.tar.bz2
askbot-10ff7a37e1403f96f73918b6b30a51da1f56a654.zip
Log when number of patterns mismatch number of URLs
-rw-r--r--askbot/utils/markup.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/askbot/utils/markup.py b/askbot/utils/markup.py
index e458e381..3b16a5b2 100644
--- a/askbot/utils/markup.py
+++ b/askbot/utils/markup.py
@@ -1,4 +1,5 @@
import re
+import logging
from askbot import const
from askbot.conf import settings as askbot_settings
from markdown2 import Markdown
@@ -29,10 +30,13 @@ def get_parser():
# Check whether we have matching links for all key terms, Other wise we ignore the key terms
# May be we should do this test in update_callback?
- print len(pattern_list), len(url_list)
if len(pattern_list) == len(url_list):
for i in range(0,len(pattern_list)):
LINK_PATTERNS.append((re.compile(pattern_list[i].strip()),url_list[i].strip()))
+ else:
+ settings_url = askbot_settings.APP_URL+'/settings/AUTOLINK/'
+ logging.debug("Number of keyterms didn't match the number of links, fix this by visiting" + settings_url)
+
return Markdown(
html4tags=True,