@@ -66,7 +66,7 @@ def run_command(self, args):
6666 def jobs (self , args ):
6767 jobs = self .jenkins .get_jobs ()
6868 for job in jobs :
69- print "%s***%s %s" % (colors .get (job ['color' ], job ['color' ]), colors ['endcollor' ], job ['name' ])
69+ print ( "%s***%s %s" % (colors .get (job ['color' ], job ['color' ]), colors ['endcollor' ], job ['name' ]) )
7070
7171 def _get_jobs (self , args ):
7272 jobs = self .jenkins .get_jobs ()
@@ -79,9 +79,9 @@ def queue(self, args):
7979 jobs = self .jenkins .get_queue_info ()
8080 if jobs :
8181 for job in jobs :
82- print "%s %s" % (job ['task' ]['name' ], job ['why' ])
82+ print ( "%s %s" % (job ['task' ]['name' ], job ['why' ]) )
8383 else :
84- print "Building Queue is empty"
84+ print ( "Building Queue is empty" )
8585
8686 def _check_job (self , job_name ):
8787 job_name = self .jenkins .get_job_name (job_name )
@@ -111,12 +111,12 @@ def info(self, args):
111111 revision = scm .find ('revision' )
112112 if revision is not None :
113113 rev = revision .text
114- print info % (last_build .get ('fullDisplayName' , 'Not Built' ),
114+ print ( info % (last_build .get ('fullDisplayName' , 'Not Built' ),
115115 last_build .get ('result' , 'Not Built' ),
116116 last_success_build .get ('fullDisplayName' , 'Not Built' ),
117117 datetime .datetime .fromtimestamp (last_build ['timestamp' ] / 1000 ) if last_build else 'Not built' ,
118118 'Yes' if last_build .get ('building' ) else 'No' ,
119- rev )
119+ rev ))
120120
121121 def set_branch (self , args ):
122122 job_name = self ._check_job (args .job_name )
@@ -130,42 +130,42 @@ def set_branch(self, args):
130130 revision .text = args .branch_name
131131 new_xml = ElementTree .tostring (root )
132132 self .jenkins .reconfig_job (job_name , new_xml )
133- print 'Done'
133+ print ( 'Done' )
134134 if new_xml is None :
135- print "Can not set revision info"
135+ print ( "Can not set revision info" )
136136
137137 def start (self , args ):
138138 for job in args .job_name :
139139 job_name = self ._check_job (job )
140140 start_status = self .jenkins .build_job (job_name )
141- print "%s: %s" % (job_name , 'started' if not start_status else start_status )
141+ print ( "%s: %s" % (job_name , 'started' if not start_status else start_status ) )
142142
143143 def stop (self , args ):
144144 job_name = self ._check_job (args .job_name )
145145 info = self .jenkins .get_job_info (job_name )
146146 build_number = info ['lastBuild' ].get ('number' )
147147 stop_status = self .jenkins .stop_build (job_name , build_number )
148- print "%s: %s" % (job_name , 'stoped' if not stop_status else stop_status )
148+ print ( "%s: %s" % (job_name , 'stoped' if not stop_status else stop_status ) )
149149
150150 def console (self , args ):
151151 job_name = self ._check_job (args .job_name )
152152 info = self .jenkins .get_job_info (job_name )
153- print info ['lastBuild' ]
153+ print ( info ['lastBuild' ])
154154 build_number = info ['lastBuild' ].get ('number' )
155155 console_out = self .jenkins .get_build_console_output (job_name , build_number )
156156 console_out = console_out .split ('\n ' )
157157 last_line_num = len (console_out )
158158 if args .n :
159159 console_out = console_out [args .n :] if args .n < 0 else console_out [:args .n ]
160- print "\n " .join (console_out )
160+ print ( "\n " .join (console_out ) )
161161 if args .i :
162162 build_info = self .jenkins .get_build_info (job_name , build_number )
163163 while build_info ['building' ]:
164164 console_out = self .jenkins .get_build_console_output (job_name , build_number )
165165 console_out = console_out .split ('\n ' )
166166 new_line_num = len (console_out )
167167 if new_line_num > last_line_num :
168- print "\n " .join (console_out [last_line_num :])
168+ print ( "\n " .join (console_out [last_line_num :]) )
169169 last_line_num = new_line_num
170170 time .sleep (3 )
171171 build_info = self .jenkins .get_build_info (job_name , build_number )
@@ -180,8 +180,8 @@ def building(self, args):
180180 if build_number :
181181 build_info = self .jenkins .get_build_info (job ['name' ], build_number )
182182 eta = (build_info ['timestamp' ] + build_info ['estimatedDuration' ]) / 1000 - time .time ()
183- print "%s estimated time left %s" % (build_info ['fullDisplayName' ],
184- datetime .timedelta (seconds = eta ))
183+ print ( "%s estimated time left %s" % (build_info ['fullDisplayName' ],
184+ datetime .timedelta (seconds = eta )))
185185 else :
186- print "Nothing is building now"
186+ print ( "Nothing is building now" )
187187
0 commit comments