Put the global declarations in the correct place

This commit is contained in:
Alberto Planas 2013-07-24 16:58:36 +02:00
parent 0f064d7d6e
commit 820ebeaff8

View File

@ -37,6 +37,9 @@ global datetime
global shelve
global wraps
global memoize
global last_build_success
def memoize(f):
"""Decorator function to implement a persistent cache.
@ -125,8 +128,6 @@ def memoize(f):
cache = shelve.open(cache_name, protocol=-1)
return _f
global memoize
def _check_repo_change_review_state(self, opts, id_, newstate, message='', supersed=None):
"""Taken from osc/osc/core.py, improved:
@ -315,7 +316,7 @@ def _check_repo_one_request(self, rq, opts):
return packs
# @memoize
@memoize
def last_build_success(apiurl, src_project, tgt_project, src_package, rev):
root = None
try:
@ -329,14 +330,11 @@ def last_build_success(apiurl, src_project, tgt_project, src_package, rev):
print 'ERROR in URL %s [%s]'%(url, e)
return root
global last_build_success
def _check_repo_buildsuccess(self, p, opts):
print 'PRE'
root_xml = last_build_success(opts.apiurl, p.sproject, p.tproject, p.spackage, p.rev)
root = ET.fromstring(root_xml)
print 'POST'
if not root:
return False
if 'code' in root.attrib: