From 1ccc4d895dd8d659d016efcd6ef8a48749aba1d0 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Mon, 15 Oct 2018 08:27:53 +0800 Subject: Revert BaseTools: PYTHON3 migration This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52.. 678f85131238622e576705117e299d81cff755c9. Python3 migration is the fundamental change. It requires every developer to install Python3. Before this migration, the well communication and wide verification must be done. But now, most people is not aware of this change, and not try it. So, Python3 migration is reverted and be moved to edk2-staging Python3 branch for the edk2 user evaluation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- .../Source/Python/UPT/Library/CommentGenerating.py | 40 ++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'BaseTools/Source/Python/UPT/Library/CommentGenerating.py') diff --git a/BaseTools/Source/Python/UPT/Library/CommentGenerating.py b/BaseTools/Source/Python/UPT/Library/CommentGenerating.py index 78d3c91581..4726629695 100644 --- a/BaseTools/Source/Python/UPT/Library/CommentGenerating.py +++ b/BaseTools/Source/Python/UPT/Library/CommentGenerating.py @@ -124,46 +124,50 @@ def GenHeaderCommentSection(Abstract, Description, Copyright, License, IsBinaryH # # Convert special character to (c), (r) and (tm). # + if isinstance(Abstract, unicode): + Abstract = ConvertSpecialUnicodes(Abstract) + if isinstance(Description, unicode): + Description = ConvertSpecialUnicodes(Description) if IsBinaryHeader: - Content += CommChar * 2 + TAB_SPACE_SPLIT + TAB_BINARY_HEADER_COMMENT + '\n' + Content += CommChar * 2 + TAB_SPACE_SPLIT + TAB_BINARY_HEADER_COMMENT + '\r\n' elif CommChar == TAB_COMMENT_EDK1_SPLIT: Content += CommChar + TAB_SPACE_SPLIT + TAB_COMMENT_EDK1_START + TAB_STAR + TAB_SPACE_SPLIT +\ - TAB_HEADER_COMMENT + '\n' + TAB_HEADER_COMMENT + '\r\n' else: - Content += CommChar * 2 + TAB_SPACE_SPLIT + TAB_HEADER_COMMENT + '\n' + Content += CommChar * 2 + TAB_SPACE_SPLIT + TAB_HEADER_COMMENT + '\r\n' if Abstract: - Abstract = Abstract.rstrip('\n') - Content += CommChar + TAB_SPACE_SPLIT + ('\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\ + Abstract = Abstract.rstrip('\r\n') + Content += CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\ (Abstract, '\n')) - Content += '\n' + CommChar + '\n' + Content += '\r\n' + CommChar + '\r\n' else: - Content += CommChar + '\n' + Content += CommChar + '\r\n' if Description: - Description = Description.rstrip('\n') - Content += CommChar + TAB_SPACE_SPLIT + ('\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\ + Description = Description.rstrip('\r\n') + Content += CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\ (Description, '\n')) - Content += '\n' + CommChar + '\n' + Content += '\r\n' + CommChar + '\r\n' # # There is no '#\n' line to separate multiple copyright lines in code base # if Copyright: - Copyright = Copyright.rstrip('\n') - Content += CommChar + TAB_SPACE_SPLIT + ('\n' + CommChar + TAB_SPACE_SPLIT).join\ + Copyright = Copyright.rstrip('\r\n') + Content += CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join\ (GetSplitValueList(Copyright, '\n')) - Content += '\n' + CommChar + '\n' + Content += '\r\n' + CommChar + '\r\n' if License: - License = License.rstrip('\n') - Content += CommChar + TAB_SPACE_SPLIT + ('\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\ + License = License.rstrip('\r\n') + Content += CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\ (License, '\n')) - Content += '\n' + CommChar + '\n' + Content += '\r\n' + CommChar + '\r\n' if CommChar == TAB_COMMENT_EDK1_SPLIT: - Content += CommChar + TAB_SPACE_SPLIT + TAB_STAR + TAB_COMMENT_EDK1_END + '\n' + Content += CommChar + TAB_SPACE_SPLIT + TAB_STAR + TAB_COMMENT_EDK1_END + '\r\n' else: - Content += CommChar * 2 + '\n' + Content += CommChar * 2 + '\r\n' return Content -- cgit v1.2.3