Revision: 4078 Author: misza13 Date: 2007-08-19 19:57:38 +0000 (Sun, 19 Aug 2007)
Log Message: ----------- Fix by Filnik (slightly modified) - exit() if no fileName specified.
Modified Paths: -------------- trunk/pywikipedia/welcome.py
Modified: trunk/pywikipedia/welcome.py =================================================================== --- trunk/pywikipedia/welcome.py 2007-08-19 16:02:25 UTC (rev 4077) +++ trunk/pywikipedia/welcome.py 2007-08-19 19:57:38 UTC (rev 4078) @@ -178,6 +178,7 @@ savedata = False # should save the signature index or not filename = 'welcome.data' # file where is stored the random signature index fileOption = False # check if the user wants to use a file or the wikipage +fileSignName = None # File name, default: None
# Script users the class wikipedia.translate() to find the right # page/user/summary/etc so the need to specify language and project have @@ -435,7 +436,7 @@ else: return True
-def defineSign(wsite, signPageTitle, fileSignName, fileOption = False): +def defineSign(wsite, signPageTitle, fileSignName = None, fileOption = False): #A little function to load the random signatures. reg = r"^* ?(.*?)$" creg = re.compile(reg, re.M) @@ -443,6 +444,9 @@ signPage = wikipedia.Page(wsite, signPageTitle) signText = signPage.get() else: + if fileSignName == None: + wikipedia.output(u'Error! - No fileName!') + exit() try: f = codecs.open(wikipediatools.absoluteFilename(fileSignName), 'r', encoding = config.console_encoding) except: