RE: Speeding up FTP upstreams

"Garth T Kidd" <garth-OnzZ1s1DREKDegMON/[email protected]> Fri, 30 Jul 2004 15:18:49 +1000
Newsgroups gmane.comp.pythin.pyds.devel
Organization Deadly Bloody Serious
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_005A_01C47648.864A36B0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

I'm not entirely sure why WeblogTool is trying to RSS-render items that
don't exist, but hopefully the attached patch will help Peter's `upstreaming
woes`__.

__ http://www.pycs.net/users/0000348/weblog/2004/07/28.html#P403

Regards,
Garth. 

------=_NextPart_000_005A_01C47648.864A36B0
Content-Type: application/octet-stream;
	name="20040730-1513-weblogrssfix.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="20040730-1513-weblogrssfix.diff"

Index: PyDS/WeblogTool.py
===================================================================
RCS file: /pyds/PyDS/PyDS/WeblogTool.py,v
retrieving revision 1.122
diff -c -r1.122 WeblogTool.py
*** PyDS/WeblogTool.py	14 Jul 2004 15:55:18 -0000	1.122
--- PyDS/WeblogTool.py	30 Jul 2004 05:11:12 -0000
***************
*** 1164,1182 ****
  		prefs = self.getPreferencesTool()
  		if fullrss==None:
  			fullrss = prefs.get('private', 'fullrss')
! 		post = self.getPost(id)
! 		if post:
! 			if category and not(category in post['categories']):
! 				category = ''
! 			if not(category):
! 				if not(post['onhome']):
! 					if len(post['categories']):
! 						category = post['categories'][0]
! 					else:
! 						category = None
! 			return self._translateItemToRSS(post, category, full=fullrss)
! 		else:
  			return None
  
  	# this method returns the items for RSS rendering. This
  	# is much like getRecentPosts, but has a different maxnumbers
--- 1164,1182 ----
  		prefs = self.getPreferencesTool()
  		if fullrss==None:
  			fullrss = prefs.get('private', 'fullrss')
! 		try: 
! 			post = self.getPost(id)
! 		except (KeyError, ValueError): 
  			return None
+ 		if category and not(category in post['categories']):
+ 			category = ''
+ 		if not(category):
+ 			if not(post['onhome']):
+ 				if len(post['categories']):
+ 					category = post['categories'][0]
+ 				else:
+ 					category = None
+ 		return self._translateItemToRSS(post, category, full=fullrss)
  
  	# this method returns the items for RSS rendering. This
  	# is much like getRecentPosts, but has a different maxnumbers

------=_NextPart_000_005A_01C47648.864A36B0--