~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/poppy/hooks.py

remove the global targetcount

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    pass
23
23
 
24
24
 
25
 
# See Hooks.targetcount.
26
 
targetcount = 0
27
 
 
28
 
 
29
25
class Hooks:
30
26
 
31
27
    clients = {}
32
28
    LOG_MAGIC = "Post-processing finished"
 
29
    _targetcount = 0
33
30
 
34
31
    def __init__(self, targetpath, logger, allow_user, cmd=None,
35
32
                 targetstart=0, perms=None, prefix=''):
43
40
    @property
44
41
    def targetcount(self):
45
42
        """A guaranteed unique integer for ensuring unique upload dirs."""
46
 
        global targetcount
47
 
        targetcount += 1
48
 
        return targetcount
 
43
        Hooks._targetcount += 1
 
44
        return Hooks._targetcount
49
45
 
50
46
    def new_client_hook(self, fsroot, host, port):
51
47
        """Prepare a new client record indexed by fsroot..."""
165
161
        #except object, e:
166
162
        #    print e
167
163
        #return False
 
164