From 214bb228984f461ae00bfd6e2847762a30ab2eee Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 20 Aug 2019 12:22:41 +0100 Subject: [PATCH] Without exception --- posts.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/posts.py b/posts.py index 8f3beaba8..e3874b283 100644 --- a/posts.py +++ b/posts.py @@ -1660,8 +1660,8 @@ def createBoxBase(baseDir: str,boxname: str, \ boxname+'?min_id='+postId+'&page=true' # get the full path of the post file filePath = postFilename - try: - if os.path.isfile(filePath): + #try: + if os.path.isfile(filePath): if currPage == pageNumber and postsOnPageCtr <= itemsPerPage: # get the post as json with open(filePath, 'r') as fp: @@ -1693,16 +1693,15 @@ def createBoxBase(baseDir: str,boxname: str, \ postId+'&page=true' # remember the last post filename for use with prev prevPostFilename = postFilename - if postsOnPageCtr > itemsPerPage: + if postsOnPageCtr >= itemsPerPage: break # count the pages - if currPage != pageNumber: - postsCtr += 1 - if postsCtr >= itemsPerPage: - postsCtr = 0 - currPage += 1 - except Exception as e: - print(e) + postsCtr += 1 + if postsCtr >= itemsPerPage: + postsCtr = 0 + currPage += 1 + #except Exception as e: + # print(e) if headerOnly: return boxHeader return boxItems