Changeset 7178
- Timestamp:
- Jun 10, 2009, 5:32:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy_misc/tools/update_lic_checksum/create_lic_file.py
r7156 r7178 43 43 '''Create licence file 'lfile' that controls files in 'fnames'.''' 44 44 45 # get username from the environment 46 username = os.getenv('USERNAME') 47 45 48 # see if there is already a licence file 46 49 if os.path.exists(lfile): … … 56 59 author = etree.SubElement(metadata, 'author') 57 60 author.tail = '\n ' 58 if arg_author != '':61 if arg_author: 59 62 author.text = arg_author 63 else: 64 author.text = username 60 65 61 66 # add each controlled file to XML tree 62 67 prev_f_tree = None 68 already_done = [] # list of handled files 63 69 for f in fnames: 70 # check we haven't already handled this file 71 if f in already_done: 72 print("Have already seen file '%s': ignored" % f) 73 continue 74 already_done.append(f) 75 64 76 # get new XML sub-tree for this file 65 77 f_tree = etree.fromstring(Datafile_Template) … … 74 86 if arg_accountable: 75 87 f_tree.find('accountable').text = arg_accountable 88 else: 89 f_tree.find('accountable').text = username 76 90 if arg_source: 77 91 f_tree.find('source').text = arg_source … … 165 179 166 180 create_file(lic_file, filenames, 167 arg_author, arg_publishable, arg_accountable, 168 arg_source, arg_ipowner, arg_ipinfo) 181 arg_author=arg_author, arg_publishable=arg_publishable, 182 arg_accountable=arg_accountable, 183 arg_source=arg_source, arg_ipowner=arg_ipowner, 184 arg_ipinfo=arg_ipinfo) 169 185 170 186 sys.exit(main(sys.argv[1:]))
Note: See TracChangeset
for help on using the changeset viewer.