<s> from django . utils . six . moves . builtins import str <EOL> import icalendar <EOL> from django . http import HttpResponse <EOL> EVENT_ITEMS = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:start>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:end>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT:location>' , '<STR_LIT:location>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> class ICalendarFeed ( object ) : <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> self . args = args <EOL> self . kwargs = kwargs <EOL> cal = icalendar . Calendar ( ) <EOL> cal . add ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> cal . add ( '<STR_LIT:version>' , '<STR_LIT>' ) <EOL> for item in list ( self . items ( ) ) : <EOL> event = icalendar . Event ( ) <EOL> for vkey , key in EVENT_ITEMS : <EOL> value = getattr ( self , '<STR_LIT>' + key ) ( item ) <EOL> if value : <EOL> event . add ( vkey , value ) <EOL> cal . add_component ( event ) <EOL> response = HttpResponse ( cal . to_ical ( ) ) <EOL> response [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> return response <EOL> def items ( self ) : <EOL> return [ ] <EOL> def item_uid ( self , item ) : <EOL> pass <EOL> def item_start ( self , item ) : <EOL> pass <EOL> def item_end ( self , item ) : <EOL> pass <EOL> def item_summary ( self , item ) : <EOL> return str ( item ) <EOL> def item_location ( self , item ) : <EOL> pass <EOL> def item_last_modified ( self , item ) : <EOL> pass <EOL> def item_created ( self , item ) : <EOL> pass </s>
