def uninstall(buildout): if _format_picked_versions: file_name, overwrite = _file_name_and_overwrite(buildout['buildout']) if file_name is None: return if os.path.isfile(file_name) and not overwrite: print_('Skipped: File %s already exists.' % file_name) else: picked_versions, required_by = (zc.buildout.easy_install .get_picked_versions()) output = _format_picked_versions(picked_versions, required_by) f = open(file_name, 'wb') f.write('\n'.join(output)) f.close() print_('Picked versions have been written to %s' % file_name)
def overwrite_picked_versions(): """ Altered behavior for print_picked_versions. Basically, print_picked_versions is called unless the version files exists. If the version file exists and overwrite is enabled the file will be removed before calling print_picked_versions. If overwriting is disabled print_picked_versions is not called and a message is printed. """ if os.path.isfile(file_name): if overwrite: os.unlink(file_name) old_print_picked_versions() else: print_('Skipped: File %s already exists.' % file_name) else: old_print_picked_versions()
def install(self): items = list(self.options.items()) items.sort() for option, value in items: print_(" %s=%r" % (option, value)) return ()