"""meoWWW configuation module""" # meoWWW # Copyright 1999 G.J. Andruk # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. import nntpclient, sys, os name = 'MeoWWW' version = '1.0b1' class config: def __init__(self): ############################################################################## ### Configurable stuff starts here. ### # Address of the NNTP reader server where we get news self.server = 'news.mit.edu' # The port where the NNTP server listens (normally 119) self.nntpport = 119 # If the news server wants AUTHINFO, set authuser and authpass here. self.authuser = '' self.authpass = '' # Address of the SMTP server where replies can be sent self.mailserver = 'outgoing.mit.edu' # This is the default Organization: tag that will appear in # posted articles. self.organization = 'MIT' # This controls the color or background image of all the # generated pages. If you want logos and banners and that # sort of junk, tack them on the end. # The plain vanilla version: ##self.body = '' # And, a slightly fancier version... self.body = ('') # These servers are semi-randomly chosen to display FAQ links # in group.py. The %s will be the group name with the dots # converted to slashes; for example, 'alt.foo.bar' will be # passed in as 'alt/foo/bar'. If you're not located in the # US, you should probably hunt down some rtfm mirrors closer # to you and replace them with the ones I list here. # Suggestions for good mirrors to use in various locales would # be welcome. self.faqurl = ( 'ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/%s/', 'ftp://mirrors.aol.com/pub/rtfm/usenet-by-hierarchy/%s/', 'http://www.cis.ohio-state.edu/hypertext/faq/' + 'usenet-faqs/bygroup/%s/top.html' ) # Yes, I actually run the generated HTML through a validator from # time to time. I'm using HTML 3.2 for wider compatibility. self.doctype='' ### End of configurable stuff. ### ############################################################################## def connect(self): if not ('authuser' in dir(self) and 'authpass' in dir(self) and self.authuser): self.authuser = self.authpass = None rh = nntpclient.NNTP(self.server, self.nntpport) try: rh.mode('READER') except: pass if self.authuser and self.authpass: rh.authinfo(self.authuser, self.authpass) return rh