makedirs(head, mode) os.mkdir(name, mode) def main(options, args): """copies all files opened in perforce to the backup server Any arguments are passed to the 'p4 opened' command """ if not options.p4: options.p4 = [''] for p4 in options.p4: p4backup(options, p4, string.join(args)) def _options(): return [ # (optstring, varname, typechar, default, help) ('o', 'outdir', ':', r'\\dber010.ber.sap.corp\Home' + '\\' + os.environ['USERNAME'], 'output directory'), ('v', 'verbose', '', None, 'verbose output'), ('p4', None, '::', None, 'p4 clients to backup'), ('version', None, '', _version, 'version information'), ] if __name__ == '__main__': import optlib optlib.optMain2(main, _options())
createZIP(options.outdir, archiveDir, options.verbose, options.tag) def _options(): return [ # (optstring, varname, typechar, default, help) ('n', 'nocopy', '', None, 'show, don\'t copy'), ('nl', None, ':', 'unix', 'text file format [unix, dos, native]'), ('o', 'outdir', ':', os.environ['TMP'], 'output directory'), ('vmake', None, '::', None, 'specify platforms for vmake'), ('list', None, '::', None, 'additional vmake prots'), ('unconditional', None, '', None, 'copy unconditional'), ('v', 'verbose', '', None, 'verbose output'), ('x', 'exclude', '::', None, 'files to exclude'), ('tgz', None, '', None, 'create .tgz archive'), ('zip', None, '', None, 'create .zip archive'), ('tag', None, ':', None, 'tag added to archive name'), ('readme', None, ':', None, 'add readme file'), ('p4tree', None, ':', None, 'p4 directory containing additional files'), ('config', None, ':', None, 'config with options ' + str(configs.keys())), ] if __name__ == '__main__': import sys import optlib args = sys.argv[1:] optlib.optMain2(main, _options(), optlib.expandFileArgs(args))