+ for command in ('install', 'delete'):
+ packageNames = []
+ key = command + '_list'
+ if key in config:
+ if isinstance(config[key], str):
+ packageNames = [config[key]]
+ elif all(isinstance(item, str) for item in config[key]):
+ packageNames = config[key]
+ else:
+ raise TypeError('only accepts strings, lists, and tuples')
+ for packageName in packageNames:
+ element = doc.createElement(command)
+ root.appendChild(element)
+ element.setAttribute('packageName', packageName)
+