aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2011-04-15 19:42:35 +0200
committercedricbonhomme <devnull@localhost>2011-04-15 19:42:35 +0200
commit657b2336256428e6d55cc8a3fd5713e51e8dc35b (patch)
treead7adb970a6138fd6c6225d48a4ece5dcbd34223 /utils.py
parentAdded picture for Diaspora. (diff)
downloadnewspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.tar.gz
newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.tar.bz2
newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.zip
Added a new form in the management page in order to set the number of articles load by feed to be loaded.
Diffstat (limited to 'utils.py')
-rwxr-xr-xutils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 20429b17..df6a22c4 100755
--- a/utils.py
+++ b/utils.py
@@ -67,6 +67,8 @@ smtp_server = config.get('mail','smtp')
username = config.get('mail','username')
password = config.get('mail','password')
+MAX_NB_ARTICLES = -1
+
# regular expression to chech URL
url_finders = [ \
re.compile("([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}|(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+)(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\),\\\"]"), \
@@ -372,7 +374,7 @@ def load_feed():
if list_of_articles != []:
list_of_articles.sort(lambda x,y: compare(y[0], x[0]))
# Walk through the list of articles for the current feed.
- for article in list_of_articles:
+ for article in list_of_articles[:MAX_NB_ARTICLES]:
sha1_hash.update(article[2].encode('utf-8'))
article_id = sha1_hash.hexdigest()
bgstack15