Changeset 86975 in vbox for trunk/src/VBox/ValidationKit/testboxscript
- Timestamp:
- Nov 25, 2020 2:45:30 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/win/fix_stale_refs.py
r82968 r86975 76 76 try: 77 77 value = QueryValueEx(hkey_product_properties, 'DisplayName')[0] 78 except WindowsError , exception:79 if exception.winerror != 2:78 except WindowsError as oXcpt: 79 if oXcpt.winerror != 2: 80 80 raise 81 81 value = '<unknown>' … … 83 83 products[product_guid] = value 84 84 product_index += 1 85 except WindowsError , exceptione:86 if exceptione.winerror != 259:87 print exceptione.strerror + '.', 'error', exceptione.winerror85 except WindowsError as oXcpt: 86 if oXcpt.winerror != 259: 87 print(oXcpt.strerror + '.', 'error', oXcpt.winerror) 88 88 CloseKey(hkey_products) 89 89 90 print 'Installed products:'90 print('Installed products:') 91 91 for product_key in sorted(products.keys()): 92 print transpose_guid(product_key), '=', products[product_key]92 print(transpose_guid(product_key), '=', products[product_key]) 93 93 94 print 94 print() 95 95 return products 96 96 … … 127 127 missing_products = get_missing_products(hkey_components) 128 128 129 print 'Missing products refer the following components:'129 print('Missing products refer the following components:') 130 130 for product_guid in sorted(missing_products.keys()): 131 131 if product_guid[1:] == '0'*31: 132 132 continue 133 print 'Product', transpose_guid(product_guid) + ':'133 print('Product', transpose_guid(product_guid) + ':') 134 134 for component_guid, component_file in missing_products[product_guid]: 135 print ' ' + transpose_guid(component_guid), '=', component_file135 print(' ' + transpose_guid(component_guid), '=', component_file) 136 136 137 print 'Remove all references to product', transpose_guid(product_guid) + '? [y/n]'137 print('Remove all references to product', transpose_guid(product_guid) + '? [y/n]') 138 138 if strtobool(raw_input().lower()): 139 139 for component_guid, component_file in missing_products[product_guid]: 140 140 hkey_component = OpenKey(hkey_components, component_guid, 0, KEY_ALL_ACCESS) 141 print 'Removing reference in ' + transpose_guid(component_guid), '=', component_file141 print('Removing reference in ' + transpose_guid(component_guid), '=', component_file) 142 142 DeleteValue(hkey_component, product_guid) 143 143 CloseKey(hkey_component) 144 144 else: 145 print 'Cancelled removal of product', transpose_guid(product_guid)145 print('Cancelled removal of product', transpose_guid(product_guid)) 146 146 147 147 CloseKey(hkey_components)
Note:
See TracChangeset
for help on using the changeset viewer.