jobfile.py (13663:9b64aeabf9a5) | jobfile.py (13671:b288ca1bcae8) |
---|---|
1# Copyright (c) 2005-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 403 unchanged lines hidden (view full) --- 412 testname = joinpath(path, filename) 413 if isfile(testname): 414 filename = testname 415 break 416 else: 417 raise AttributeError("Could not find file '%s'" % jobfile) 418 419 data = {} | 1# Copyright (c) 2005-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 403 unchanged lines hidden (view full) --- 412 testname = joinpath(path, filename) 413 if isfile(testname): 414 filename = testname 415 break 416 else: 417 raise AttributeError("Could not find file '%s'" % jobfile) 418 419 data = {} |
420 execfile(filename, data) | 420 exec(compile(open(filename).read(), filename, 'exec'), data) |
421 if 'conf' not in data: 422 raise ImportError('cannot import name conf from %s' % jobfile) 423 return data['conf'] 424 425def main(conf=None): 426 usage = 'Usage: %s [-b] [-c] [-v]' % sys.argv[0] 427 if conf is None: 428 usage += ' <jobfile>' --- 45 unchanged lines hidden --- | 421 if 'conf' not in data: 422 raise ImportError('cannot import name conf from %s' % jobfile) 423 return data['conf'] 424 425def main(conf=None): 426 usage = 'Usage: %s [-b] [-c] [-v]' % sys.argv[0] 427 if conf is None: 428 usage += ' <jobfile>' --- 45 unchanged lines hidden --- |