|
Last change
on this file since 7604 was
7541,
checked in by uli, 15 years ago
|
|
Add sources copied from current multi-mechanize GIT repos.
|
|
File size:
548 bytes
|
| Line | |
|---|
| 1 | # |
|---|
| 2 | # Copyright (c) 2010 Corey Goldberg (corey@goldb.org) |
|---|
| 3 | # License: GNU LGPLv3 |
|---|
| 4 | # |
|---|
| 5 | # This file is part of Multi-Mechanize |
|---|
| 6 | # |
|---|
| 7 | # |
|---|
| 8 | # |
|---|
| 9 | # this is a mock plugin. |
|---|
| 10 | # it does nothing but return random custom_timer data. |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | import random |
|---|
| 14 | import time |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | class Transaction(object): |
|---|
| 19 | def __init__(self): |
|---|
| 20 | self.custom_timers = {} |
|---|
| 21 | |
|---|
| 22 | def run(self): |
|---|
| 23 | r = random.uniform(1, 2) |
|---|
| 24 | time.sleep(r) |
|---|
| 25 | self.custom_timers['Example_Timer'] = r |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | if __name__ == '__main__': |
|---|
| 29 | trans = Transaction() |
|---|
| 30 | trans.run() |
|---|
| 31 | print trans.custom_timers |
|---|
Note: See
TracBrowser for help on using the repository browser.