equal
deleted
inserted
replaced
44 """recursive looping function""" |
44 """recursive looping function""" |
45 if seqin: # any more sequences to process? |
45 if seqin: # any more sequences to process? |
46 for item in seqin[0]: |
46 for item in seqin[0]: |
47 newcomb = comb + [item] # add next item to current combination |
47 newcomb = comb + [item] # add next item to current combination |
48 # call rloop w/ remaining seqs, newcomb |
48 # call rloop w/ remaining seqs, newcomb |
49 for item in rloop(seqin[1:], newcomb): |
49 for item in rloop(seqin[1:], newcomb): |
50 yield item # seqs and newcomb |
50 yield item # seqs and newcomb |
51 else: # processing last sequence |
51 else: # processing last sequence |
52 yield comb # comb finished, add to list |
52 yield comb # comb finished, add to list |
53 return rloop(seqin, []) |
53 return rloop(seqin, []) |
54 |
54 |
93 func() |
93 func() |
94 finally: |
94 finally: |
95 self.start() |
95 self.start() |
96 self.func = auto_restart_func |
96 self.func = auto_restart_func |
97 self.name = func.__name__ |
97 self.name = func.__name__ |
98 |
98 |
99 def start(self): |
99 def start(self): |
100 self._t = Timer(self.interval, self.func) |
100 self._t = Timer(self.interval, self.func) |
101 self._t.start() |
101 self._t.start() |
102 |
102 |
103 def cancel(self): |
103 def cancel(self): |
118 finally: |
118 finally: |
119 self.running_threads.remove(self) |
119 self.running_threads.remove(self) |
120 Thread.__init__(self, target=auto_remove_func) |
120 Thread.__init__(self, target=auto_remove_func) |
121 self.running_threads = running_threads |
121 self.running_threads = running_threads |
122 self._name = target.__name__ |
122 self._name = target.__name__ |
123 |
123 |
124 def start(self): |
124 def start(self): |
125 self.running_threads.append(self) |
125 self.running_threads.append(self) |
126 Thread.start(self) |
126 Thread.start(self) |
127 |
127 |
128 @property |
128 @property |