diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-11 05:12:43 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-11 05:12:43 +0000 |
commit | 7ddad1331dfa5ec5c827665053b95517efabbc8d (patch) | |
tree | f0cee68420551e1e2e9d21d7af7eab3ae9490e52 | |
parent | de20041348e39902e1e1c28f45c35c466278c6f8 (diff) | |
parent | a17cc37541597fbb02676bbda5afcc2b1077cbf7 (diff) | |
download | doc_generation-7ddad1331dfa5ec5c827665053b95517efabbc8d.tar.gz |
Snap for 8570526 from a17cc37541597fbb02676bbda5afcc2b1077cbf7 to mainline-media-swcodec-releaseaml_swc_341711000aml_swc_341619000aml_swc_341513600aml_swc_341312300aml_swc_341312020aml_swc_341111000aml_swc_341011020aml_swc_340922010aml_swc_331911000aml_swc_331712000aml_swc_331612000aml_swc_331511000aml_swc_331410000aml_swc_331318000aml_swc_331116000aml_swc_331012020android14-mainline-media-swcodec-releaseandroid13-mainline-media-swcodec-release
Change-Id: I4b20e8ce201c6800720f841c0a19a342913facf4
-rw-r--r-- | Android.bp | 9 | ||||
-rw-r--r-- | switcher4.py | 72 |
2 files changed, 36 insertions, 45 deletions
@@ -19,13 +19,4 @@ package { python_binary_host { name: "switcher4", srcs: ["switcher4.py",], - - version: { - py2: { - enabled: true, - }, - py3: { - enabled: false, - }, - }, } diff --git a/switcher4.py b/switcher4.py index 6cd7739..58f1ba3 100644 --- a/switcher4.py +++ b/switcher4.py @@ -43,7 +43,7 @@ java_ref_root = os.getcwd() kotlin_ref_root = os.path.join(java_ref_root, "kotlin") root = os.path.split(java_ref_root)[1] if root != "reference": - print ("You must cd to the refocs reference/ root directoy") + print("You must cd to the refocs reference/ root directory") sys.exit() @@ -82,10 +82,10 @@ def insert_stub(doc, java, both): stubs = stubs+1 if verbose: - print "File: ", stubs, doc + print("File: ", stubs, doc) else: fn = os.path.split(doc) - print "File: ", stubs, fn[1], "\r", + print("File: ", stubs, fn[1], end="\r") if (java): java_stubs = java_stubs + 1 @@ -137,7 +137,7 @@ def scan_files(stem): solo = 0 both = 0 - print "*** PASS1 (Java) ***" + print("*** PASS1 (Java) ***") maxed_out = False for root, dirs, files in os.walk(java_source_abs_path): if maxed_out: @@ -147,7 +147,7 @@ def scan_files(stem): ext = ext[1] if not ext: # this catches package-lists with no extension - print "***", os.path.join(root, file_) + print("***", os.path.join(root, file_)) elif ext != ".html": # filter out png, yaml, etc continue @@ -167,23 +167,23 @@ def scan_files(stem): else: # no kotlin content if (show_solo): - print "solo: ", doc + print("solo: ", doc) insert_stub(doc, True, False) solo = solo+1 if max_stubs>0 and stubs>=max_stubs: - print - print "max java stubs: ", max_stubs + print() + print("max java stubs: ", max_stubs) maxed_out = True; break - print "Java+Kotlin:", both, "Only Java:", solo - print + print("Java+Kotlin:", both, "Only Java:", solo) + print() # PASS 2 # Loop over kotlin content, create stubs for Kotlin-only APIs - print "*** PASS2 (Kotlin) ***" + print("*** PASS2 (Kotlin) ***") solo = 0 both = 0 maxed_out = False @@ -196,7 +196,7 @@ def scan_files(stem): ext = ext[1] if not ext: # this catches package-lists with no extension - print "***", os.path.join(root, file_) + print("***", os.path.join(root, file_)) elif ext != ".html": # filter out png, yaml, etc continue @@ -217,20 +217,20 @@ def scan_files(stem): # no java content # create the kotlin stub file if (show_solo): - print "solo: ", doc + print("solo: ", doc) insert_stub(doc , False, False) solo = solo+1 if (max_stubs>0 and stubs>=max_stubs): - print - print "max koltin stubs: ", max_stubs + print() + print("max koltin stubs: ", max_stubs) maxed_out = True; break - print "Java+Kotlin:", both, "Only Kotlin:", solo - print - print "Java: ", java_stubs, " Kotlin: ", kotlin_stubs, "Total: ", java_stubs + kotlin_stubs + print("Java+Kotlin:", both, "Only Kotlin:", solo) + print() + print("Java: ", java_stubs, " Kotlin: ", kotlin_stubs, "Total: ", java_stubs + kotlin_stubs) def main(argv): @@ -243,56 +243,56 @@ def main(argv): try: opts, args = getopt.getopt(argv,"",["work","verbose","solo","max="]) except getopt.GetoptError: - print 'USAGE: switcher --work --verbose --solo --max=<max_stubs> platform|androidx|support|chrome' + print('USAGE: switcher --work --verbose --solo --max=<max_stubs> platform|androidx|support|chrome') sys.exit(2) for opt, arg in opts: if opt == '--work': work = True elif opt == "--verbose": - print "verbose" + print("verbose") verbose = True elif opt == "--solo": - print "verbose" + print("verbose") show_solo = True elif opt == "--max": max_stubs = int(arg) - print "max ", max_stubs + print("max ", max_stubs) if len(args)>0: source = args[0] if source == "platform": stem = "android" - print - print "*** PLATFORM PAGES ***" - print "======================" + print() + print("*** PLATFORM PAGES ***") + print("======================") # Insert the switchers at the top level first insert_platform_summaries() elif source == "androidx": stem = "androidx" - print - print "*** ANDROIDX SUPPORT LIBRARY PAGES ***" - print "======================================" + print() + print("*** ANDROIDX SUPPORT LIBRARY PAGES ***") + print("======================================") elif source == "support": stem = "android/support/v4/media" - print - print "*** ANDROIDX SUPPORT LIBRARY PAGES ***" - print "======================================" + print() + print("*** ANDROIDX SUPPORT LIBRARY PAGES ***") + print("======================================") elif source == "chrome": stem = "org/chromium/support_lib_boundary" - print - print "*** ANDROIDX CHROMIUM PAGES ***" - print "===============================" + print() + print("*** ANDROIDX CHROMIUM PAGES ***") + print("===============================") if (len(stem)>0): scan_files(stem) - print " *** DONE ***" + print(" *** DONE ***") else: - print 'You must specify one of: platform|androidx|support|chrome' + print('You must specify one of: platform|androidx|support|chrome') |