[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pywikipediabot-users
Subject:    [pyWikipediaBot-users] pywikipedia template.py,1.42,1.43
From:       Cyde Weys <cydeweys () users ! sourceforge ! net>
Date:       2006-05-30 17:59:24
Message-ID: E1Fl8V4-0005ya-MC () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/pywikipediabot/pywikipedia
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12325

Modified Files:
	template.py 
Log Message:
A few minor bugfixes.


Index: template.py
===================================================================
RCS file: /cvsroot/pywikipediabot/pywikipedia/template.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** template.py	3 May 2006 22:02:34 -0000	1.42
--- template.py	30 May 2006 17:59:21 -0000	1.43
***************
*** 33,37 ****
  -extras      Specify this to signal that all parameters are templates that should \
                either be
               substituted or removed.  Allows you to input way more than just two.  \
                Not
!              compatible with -xml ( (yet  Disables template replacement.
  
  other:       First argument is the old template name, second one is the new
--- 33,37 ----
  -extras      Specify this to signal that all parameters are templates that should \
                either be
               substituted or removed.  Allows you to input way more than just two.  \
                Not
!              compatible with -xml (yet)  Disables template replacement.
  
  other:       First argument is the old template name, second one is the new
***************
*** 129,133 ****
              templateName = '[' + templateName[0].upper() + templateName[0].lower() \
+ ']' + templateName[1:]  templateName = re.sub(' ', '[_ ]', templateName)
!         templateRegex = re.compile(r'\{\{([mM][sS][gG]:)?' + templateName + \
'(?P<parameters>\|[^}]+|)}}')  for entry in dump.parse():
              if templateRegex.search(entry.text):
--- 129,133 ----
              templateName = '[' + templateName[0].upper() + templateName[0].lower() \
+ ']' + templateName[1:]  templateName = re.sub(' ', '[_ ]', templateName)
!         templateRegex = re.compile(r'\{\{ *([mM][sS][gG]:)?' + templateName + ' \
*(?P<parameters>\|[^}]+|) *}}')  for entry in dump.parse():
              if templateRegex.search(entry.text):
***************
*** 207,211 ****
  
          # get edit summary message
! 	allTemplates = (', ').join(old)
  	if self.editSummary:
  	    wikipedia.setAction(self.editSummary)
--- 207,214 ----
  
          # get edit summary message
! 	if isinstance(self.old, list):
! 	    allTemplates = (', ').join(old)
! 	else:
! 	    allTemplates = old
  	if self.editSummary:
  	    wikipedia.setAction(self.editSummary)
***************
*** 247,251 ****
                  old = '[' + old[0].upper() + old[0].lower() + ']' + old[1:]
              old = re.sub('[_ ]', '[_ ]', old)
!             templateRegex = re.compile(r'\{\{([mM][sS][gG]:)?' + old + \
'(?P<parameters>\|[^}]+|)}}')  
              if self.remove:
--- 250,254 ----
                  old = '[' + old[0].upper() + old[0].lower() + ']' + old[1:]
              old = re.sub('[_ ]', '[_ ]', old)
!             templateRegex = re.compile(r'\{\{ *(?:[Tt]emplate:|[mM][sS][gG]:)?' + \
old + ' *(?P<parameters>\|[^}]+|) *}}')  
              if self.remove:
***************
*** 323,327 ****
  	gen = iter(pages)
      elif extras:
! 	gen =  pagegenerators.ReferringPagesGenerator(oldTemplate, onlyTemplateInclusion = \
True)  else:
          gen = pagegenerators.ReferringPageGenerator(oldTemplate, \
                onlyTemplateInclusion = True)
--- 326,330 ----
  	gen = iter(pages)
      elif extras:
! 	gen = pagegenerators.ReferringPagesGenerator(oldTemplate, onlyTemplateInclusion = \
True)  else:
          gen = pagegenerators.ReferringPageGenerator(oldTemplate, \
onlyTemplateInclusion = True)



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
pyWikipediaBot-users mailing list
pyWikipediaBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pywikipediabot-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic