@@ -87,14 +87,16 @@ def project(self, project_key, expand=None, favourite=False, clover_enabled=Fals
8787 resource = 'project/{}' .format (project_key )
8888 return self .base_list_call (resource , expand , favourite , clover_enabled , start_index = 0 , max_results = 25 )
8989
90- def project_plans (self , project_key ):
90+ def project_plans (self , project_key , max_results = 25 ):
9191 """
9292 Returns a generator with the plans in a given project
9393 :param project_key: Project key
94+ :param max_results:
9495 :return: Generator with plans
9596 """
96- resource = 'project/{}' .format (project_key , max_results = 25 )
97- return self .base_list_call (resource , expand = 'plans' , favourite = False , clover_enabled = False , max_results = 25 ,
97+ resource = 'project/{}' .format (project_key , max_results = max_results )
98+ return self .base_list_call (resource , expand = 'plans' , favourite = False ,
99+ clover_enabled = False , max_results = max_results ,
98100 elements_key = 'plans' , element_key = 'plan' )
99101
100102 def plans (self , expand = None , favourite = False , clover_enabled = False , start_index = 0 , max_results = 25 ):
@@ -150,10 +152,10 @@ def enable_plan(self, plan_key):
150152
151153 """ Branches """
152154
153- def search_branches (self , plan_key , include_default_branch = True , max_results = 25 ):
155+ def search_branches (self , plan_key , include_default_branch = True , max_results = 25 , start = 0 ):
154156 params = {
155157 'max-result' : max_results ,
156- 'start-index' : 0 ,
158+ 'start-index' : start ,
157159 'masterPlanKey' : plan_key ,
158160 'includeMasterBranch' : include_default_branch
159161 }
@@ -310,7 +312,7 @@ def plan_results(self, project_key, plan_key, expand=None, favourite=False, clov
310312 label = label , issue_key = issue_key , start_index = start_index , max_results = max_results ,
311313 include_all_states = include_all_states )
312314
313- def build_result (self , build_key , expand = None , include_all_states = False ):
315+ def build_result (self , build_key , expand = None , include_all_states = False , start = 0 , max_results = 25 ):
314316 """
315317 Returns details of a specific build result
316318 :param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
@@ -319,12 +321,15 @@ def build_result(self, build_key, expand=None, include_all_states=False):
319321 :param build_key: Should be in the form XX-YY[-ZZ]-99, that is, the last token should be an integer representing
320322 the build number
321323 :param include_all_states
324+ :param start:
325+ :param max_results:
322326 """
323327 try :
324328 int (build_key .split ('-' )[- 1 ])
325329 resource = "result/{}" .format (build_key )
326330 return self .base_list_call (resource , expand , favourite = False , clover_enabled = False ,
327- start_index = 0 , max_results = 25 , include_all_states = include_all_states )
331+ start_index = start , max_results = max_results ,
332+ include_all_states = include_all_states )
328333 except ValueError :
329334 raise ValueError ('The key "{}" does not correspond to a build result' .format (build_key ))
330335
@@ -654,10 +659,8 @@ def upload_plugin(self, plugin_path):
654659 files = {
655660 'plugin' : open (plugin_path , 'rb' )
656661 }
657- headers = {
658- 'X-Atlassian-Token' : 'nocheck'
659- }
660- upm_token = self .request (method = 'GET' , path = 'rest/plugins/1.0/' , headers = headers , trailing = True ).headers [
661- 'upm-token' ]
662+ upm_token = \
663+ self .request (method = 'GET' , path = 'rest/plugins/1.0/' , headers = self .no_check_headers , trailing = True ).headers [
664+ 'upm-token' ]
662665 url = 'rest/plugins/1.0/?token={upm_token}' .format (upm_token = upm_token )
663- return self .post (url , files = files , headers = headers )
666+ return self .post (url , files = files , headers = self . no_check_headers )
0 commit comments