From e6b7979d1787beb1346cb7885244dea4b57c3f9c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 27 May 1994 13:33:17 +0000 Subject: Quentin's latest version --- Demo/scripts/newslist.py | 189 +++++++++++++++++++++++++++++------------------ 1 file changed, 119 insertions(+), 70 deletions(-) diff --git a/Demo/scripts/newslist.py b/Demo/scripts/newslist.py index b0ac134..312fd0d 100755 --- a/Demo/scripts/newslist.py +++ b/Demo/scripts/newslist.py @@ -12,7 +12,15 @@ # The -a option causes a complete list of all groups to be read from # the server rather than just the ones which have appeared since last # execution. This recreates the local list from scratch. Use this on -# the first invocation of the program. +# the first invocation of the program, and from time to time thereafter. +# When new groups are first created they may appear on your server as +# empty groups. By default, empty groups are ignored by the -a option. +# However, these new groups will not be created again, and so will not +# appear in the server's list of 'new groups' at a later date. Hence it +# won't appear until you do a '-a' after some articles have appeared. +# +# I should really keep a list of ignored empty groups and re-check them +# for articles on every run, but I haven't got around to it yet. # # This assumes an NNTP news feed. # @@ -31,16 +39,15 @@ import sys,nntplib, string, marshal, time, os, posix, string # Top directory. # Filenames which don't start with / are taken as being relative to this. -##topdir='/anfs/qsbigdisc/web/html/newspage' -topdir = '/hosts/buizerd/ufs/www/cwi/cwionly/newstree' +topdir='/anfs/qsbigdisc/web/html/newspage' # The name of your NNTP host # eg. -# newshost = 'nntp-serv.cam.ac.uk' +# newshost = 'nntp-serv.cl.cam.ac.uk' # or use following to get the name from the NNTPSERVER environment # variable: -##newshost = posix.environ['NNTPSERVER'] -newshost = 'charon.cwi.nl' +# newshost = posix.environ['NNTPSERVER'] +newshost = 'nntp-serv.cl.cam.ac.uk' # The filename for a local cache of the newsgroup list treefile = 'grouptree' @@ -48,8 +55,7 @@ treefile = 'grouptree' # The filename for descriptions of newsgroups # I found a suitable one at ftp.uu.net in /uunet-info/newgroups.gz # You can set this to '' if you don't wish to use one. -##descfile = 'newsgroups' -descfile = '/usr/lib/news/newsgroups' +descfile = 'newsgroups' # The directory in which HTML pages should be created # eg. @@ -60,19 +66,22 @@ pagedir = topdir # The html prefix which will refer to this directory # eg. # httppref = '/newspage/', -# or leave blank for relative links -# between pages. (Recommended) +# or leave blank for relative links between pages: (Recommended) +# httppref = '' httppref = '' # The name of the 'root' news page in this directory. # A .html suffix will be added. -##rootpage = 'root' -rootpage = 'index' +rootpage = 'root' # Set skipempty to 0 if you wish to see links to empty groups as well. # Only affects the -a option. -##skipempty = 1 -skipempty = 0 +skipempty = 1 + +# pagelinkicon can contain html to put an icon after links to +# further pages. This helps to make important links stand out. +# Set to '' if not wanted, or '...' is quite a good one. +pagelinkicon='... ' # --------------------------------------------------------------------- # Less important personal preferences: @@ -150,8 +159,8 @@ def printtree(f, tree, indent, p): if l > sublistsize and indent>0: # Create a new page and a link to it f.write('
  • ') - f.write(p[1:]+'.* ...') - f.write('\n') + f.write(p[1:]+'.*') + f.write(''+pagelinkicon+'\n') createpage(p[1:], tree, p) return @@ -161,7 +170,7 @@ def printtree(f, tree, indent, p): kl.sort() if indent > 0: # Create a sub-list - f.write('
  • '+p[1:]+'\n