13 | | if number : |
14 | | sys.stdout.write("Adding %i billing codes...\n" % number) |
15 | | billingcodes = [ "test-billingcode-%05i" % i for i in range(number) ] |
16 | | argsfile = open("arguments.list", "w") |
17 | | argsfile.write('--add\n--reset\n--description\n"a billing code"\n') |
18 | | for bname in billingcodes : |
19 | | argsfile.write("%s\n" % bname) |
20 | | argsfile.close() |
21 | | before = time.time() |
22 | | os.system('pkbcodes --arguments arguments.list') |
23 | | after = time.time() |
24 | | sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before)) |
| 13 | sys.stdout.write("Adding %i billing codes...\n" % number) |
| 14 | billingcodes = [ "test-billingcode-%05i" % i for i in range(number) ] |
| 15 | argsfile = open("arguments.list", "w") |
| 16 | argsfile.write('--add\n--reset\n--description\n"a billing code"\n') |
| 17 | for bname in billingcodes : |
| 18 | argsfile.write("%s\n" % bname) |
| 19 | argsfile.close() |
| 20 | before = time.time() |
| 21 | os.system('pkbcodes --arguments arguments.list') |
| 22 | after = time.time() |
| 23 | sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before)) |
36 | | if number : |
37 | | sys.stdout.write("Adding %i printers...\n" % number) |
38 | | printernames = [ "test-printer-%05i" % i for i in range(number) ] |
39 | | argsfile = open("arguments.list", "w") |
40 | | argsfile.write('--add\n--charge\n0.05\n--maxjobsize\n5\n--passthrough\n--description\n"a printer"\n') |
41 | | for pname in printernames : |
42 | | argsfile.write("%s\n" % pname) |
43 | | argsfile.close() |
44 | | before = time.time() |
45 | | os.system('pkprinters --arguments arguments.list') |
46 | | after = time.time() |
47 | | sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before)) |
| 35 | sys.stdout.write("Adding %i printers...\n" % number) |
| 36 | printernames = [ "test-printer-%05i" % i for i in range(number) ] |
| 37 | argsfile = open("arguments.list", "w") |
| 38 | argsfile.write('--add\n--charge\n0.05\n--maxjobsize\n5\n--passthrough\n--description\n"a printer"\n') |
| 39 | for pname in printernames : |
| 40 | argsfile.write("%s\n" % pname) |
| 41 | argsfile.close() |
| 42 | before = time.time() |
| 43 | os.system('pkprinters --arguments arguments.list') |
| 44 | after = time.time() |
| 45 | sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before)) |
59 | | if number : |
60 | | sys.stdout.write("Adding %i users...\n" % number) |
61 | | usernames = [ "test-user-%05i" % i for i in range(number) ] |
62 | | argsfile = open("arguments.list", "w") |
63 | | argsfile.write('--add\n--limitby\nbalance\n--balance\n50.0\n') |
64 | | for uname in usernames : |
65 | | argsfile.write("%s\n" % uname) |
66 | | argsfile.close() |
67 | | before = time.time() |
68 | | os.system('edpykota --arguments arguments.list') |
69 | | after = time.time() |
70 | | sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before)) |
| 57 | sys.stdout.write("Adding %i users...\n" % number) |
| 58 | usernames = [ "test-user-%05i" % i for i in range(number) ] |
| 59 | argsfile = open("arguments.list", "w") |
| 60 | argsfile.write('--add\n--limitby\nbalance\n--balance\n50.0\n') |
| 61 | for uname in usernames : |
| 62 | argsfile.write("%s\n" % uname) |
| 63 | argsfile.close() |
| 64 | before = time.time() |
| 65 | os.system('edpykota --arguments arguments.list') |
| 66 | after = time.time() |
| 67 | sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before)) |
84 | | createBillingCodes(int(sys.argv[1])) |
85 | | createPrinters(int(sys.argv[2])) |
86 | | createUsers(int(sys.argv[3])) |
87 | | deleteBillingCodes() |
88 | | deleteUsers() # NB : either this one or the one below |
89 | | deletePrinters() # also delete user print quota entries. |
| 81 | nbbillingcodes = int(sys.argv[1]) |
| 82 | nbprinters = int(sys.argv[2]) |
| 83 | nbusers = int(sys.argv[3]) |
| 84 | if nbbillingcodes : |
| 85 | createBillingCodes(nbbillingcodes) |
| 86 | if nbprinters : |
| 87 | createPrinters(nbprinters) |
| 88 | if nbusers : |
| 89 | createUsers(nbusers) |
| 90 | if nbbillingcodes : |
| 91 | deleteBillingCodes() |
| 92 | if nbusers : |
| 93 | deleteUsers() # NB : either this one or the one below |
| 94 | if nbprinters : |
| 95 | deletePrinters() # also delete user print quota entries. |