#NEWLINE# def __init__( self , data ) : #NEWLINE# #INDENT# if ( 'channels' in data ) : #NEWLINE# #INDENT# data = data [ 'channels' ] #NEWLINE# #UNINDENT# self . data = data #NEWLINE# keys = data . keys ( ) #NEWLINE# for key in keys : #NEWLINE# #INDENT# if ( key [ 0 ] != '#' ) : #NEWLINE# #INDENT# data [ ( '#' + key ) ] = data . pop ( key ) #NEWLINE# #UNINDENT# #UNINDENT# self . channels = data . keys ( ) #NEWLINE# self . events = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( channel , val ) in self . data . iteritems ( ) : #NEWLINE# #INDENT# for event in val [ 'events' ] : #NEWLINE# #INDENT# event_set = self . events . get ( event , set ( ) ) #NEWLINE# event_set . add ( channel ) #NEWLINE# self . events [ event ] = event_set #NEWLINE# #UNINDENT# #UNINDENT# self . projects = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( channel , val ) in self . data . iteritems ( ) : #NEWLINE# #INDENT# for project in val [ 'projects' ] : #NEWLINE# #INDENT# project_set = self . projects . get ( project , set ( ) ) #NEWLINE# project_set . add ( channel ) #NEWLINE# self . projects [ project ] = project_set