#NEWLINE# def add_job( self , str_job_name ) : #NEWLINE# #INDENT# if ( str_job_name in self . get_job_dict ( ) ) : #NEWLINE# #INDENT# return ( 'Job %s has in View %s' % ( str_job_name , self . name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not self . get_jenkins_obj ( ) . has_job ( str_job_name ) ) : #NEWLINE# #INDENT# return ( 'Job %s is not known - available: %s' % ( str_job_name , ', ' . join ( self . get_jenkins_obj ( ) . get_jobs_list ( ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'description' : '' , #NEWLINE# 'statusFilter' : '' , #NEWLINE# 'useincluderegex' : 'on' , #NEWLINE# 'includeRegex' : '' , #NEWLINE# 'columns' : [ { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.StatusColumn' , #NEWLINE# 'kind' : 'hudson.views.StatusColumn' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.WeatherColumn' , #NEWLINE# 'kind' : 'hudson.views.WeatherColumn' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.JobColumn' , #NEWLINE# 'kind' : 'hudson.views.JobColumn' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.LastSuccessColumn' , #NEWLINE# 'kind' : 'hudson.views.LastSuccessColumn' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.LastFailureColumn' , #NEWLINE# 'kind' : 'hudson.views.LastFailureColumn' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.LastDurationColumn' , #NEWLINE# 'kind' : 'hudson.views.LastDurationColumn' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'stapler-class' : 'hudson.views.BuildButtonColumn' , #NEWLINE# 'kind' : 'hudson.views.BuildButtonColumn' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'Submit' : 'OK' , #NEWLINE# #UNINDENT# } #NEWLINE# data [ 'name' ] = self . name #NEWLINE# for job in self . get_job_dict ( ) . keys ( ) : #NEWLINE# #INDENT# data [ job ] = 'on' #NEWLINE# #UNINDENT# data [ str_job_name ] = 'on' #NEWLINE# data [ 'json' ] = data . copy ( ) #NEWLINE# self . post_data ( ( '%sconfigSubmit' % self . baseurl ) , urllib . urlencode ( data ) ) #NEWLINE# return ( 'Job %s is add in View %s successful' % ( str_job_name , self . baseurl ) )