feeds: replacement code for descriptors
This commit is contained in:
		@@ -160,6 +160,25 @@ class FeedBase(object):
 | 
				
			|||||||
        if match is not None:
 | 
					        if match is not None:
 | 
				
			||||||
            return match.getparent().remove(match)
 | 
					            return match.getparent().remove(match)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def from_bool(self, x):
 | 
				
			||||||
 | 
					        return (x or '').lower() != 'false'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def to_bool(self, x):
 | 
				
			||||||
 | 
					        return 'true' if value else 'false'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def from_time(self, x):
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            return parse_time(x)
 | 
				
			||||||
 | 
					        except ValueError:
 | 
				
			||||||
 | 
					            return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def to_time(self, x):
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            time = parse_time(value)
 | 
				
			||||||
 | 
					            return time.strftime(instance.timeFormat)
 | 
				
			||||||
 | 
					        except ValueError:
 | 
				
			||||||
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def tostring(self, **k):
 | 
					    def tostring(self, **k):
 | 
				
			||||||
        """ Returns string using lxml. Arguments passed to tostring """
 | 
					        """ Returns string using lxml. Arguments passed to tostring """
 | 
				
			||||||
        return etree.tostring(self.xml, **k)
 | 
					        return etree.tostring(self.xml, **k)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user