stats.py (1881:fc205a7edd58) | stats.py (1918:0c4f083eccc8) |
---|---|
1#!/usr/bin/env python 2 3# Copyright (c) 2003-2004 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 451 unchanged lines hidden (view full) --- 460 options.user = getpass.getuser() 461 options.runs = None 462 options.system = 'client' 463 options.get = None 464 options.binned = False 465 options.graph = False 466 options.ticks = False 467 options.printmode = 'G' | 1#!/usr/bin/env python 2 3# Copyright (c) 2003-2004 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 451 unchanged lines hidden (view full) --- 460 options.user = getpass.getuser() 461 options.runs = None 462 options.system = 'client' 463 options.get = None 464 options.binned = False 465 options.graph = False 466 options.ticks = False 467 options.printmode = 'G' |
468 jobfilename = 'Test.py' |
|
468 options.jobfile = None 469 options.all = False 470 | 469 options.jobfile = None 470 options.all = False 471 |
471 opts, args = getopts(sys.argv[1:], '-BEFG:ad:g:h:j:pr:s:u:T:') | 472 opts, args = getopts(sys.argv[1:], '-BEFG:Jad:g:h:j:pr:s:u:T:') |
472 for o,a in opts: 473 if o == '-B': 474 options.binned = True 475 if o == '-E': 476 options.printmode = 'E' 477 if o == '-F': 478 options.printmode = 'F' 479 if o == '-G': 480 options.get = a 481 if o == '-a': 482 options.all = True 483 if o == '-d': 484 options.db = a 485 if o == '-g': 486 options.graph = True; 487 options.graphdir = a 488 if o == '-h': 489 options.host = a | 473 for o,a in opts: 474 if o == '-B': 475 options.binned = True 476 if o == '-E': 477 options.printmode = 'E' 478 if o == '-F': 479 options.printmode = 'F' 480 if o == '-G': 481 options.get = a 482 if o == '-a': 483 options.all = True 484 if o == '-d': 485 options.db = a 486 if o == '-g': 487 options.graph = True; 488 options.graphdir = a 489 if o == '-h': 490 options.host = a |
491 if o == '-J': 492 jobfilename = None |
|
490 if o == '-j': | 493 if o == '-j': |
491 options.jobfile = JobFile(a) | 494 jobfilename = a |
492 if o == '-p': 493 options.passwd = getpass.getpass() 494 if o == '-r': 495 options.runs = a 496 if o == '-u': 497 options.user = a 498 if o == '-s': 499 options.system = a 500 if o == '-T': 501 options.ticks = a 502 | 495 if o == '-p': 496 options.passwd = getpass.getpass() 497 if o == '-r': 498 options.runs = a 499 if o == '-u': 500 options.user = a 501 if o == '-s': 502 options.system = a 503 if o == '-T': 504 options.ticks = a 505 |
503 if options.jobfile: | 506 if jobfilename: 507 options.jobfile = JobFile(jobfilename) |
504 if not options.host: 505 options.host = options.jobfile.dbhost 506 if not options.db: 507 options.db = options.jobfile.statdb 508 509 if not options.host: 510 sys.exit('Database server must be provided from a jobfile or -h') 511 --- 13 unchanged lines hidden --- | 508 if not options.host: 509 options.host = options.jobfile.dbhost 510 if not options.db: 511 options.db = options.jobfile.statdb 512 513 if not options.host: 514 sys.exit('Database server must be provided from a jobfile or -h') 515 --- 13 unchanged lines hidden --- |