From 7e89aa20442ec64fe61705fbc9ad89aa48c47184 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 29 Mar 2018 09:33:21 +0100 Subject: [PATCH] whitespace python3 cleanup --- src/pinmux_generator.py | 6 ++-- src/spec/__init__.py | 4 +-- src/spec/m_class.py | 64 +++++++++++++++++++---------------------- 3 files changed, 35 insertions(+), 39 deletions(-) diff --git a/src/pinmux_generator.py b/src/pinmux_generator.py index 6b84525..7d2ddad 100644 --- a/src/pinmux_generator.py +++ b/src/pinmux_generator.py @@ -49,7 +49,7 @@ if __name__ == '__main__': 'version=', ]) except getopt.GetoptError as err: - print "ERROR: %s" % str(err) + print ("ERROR: %s" % str(err)) printhelp() sys.exit(1) @@ -73,7 +73,7 @@ if __name__ == '__main__': if pinspec: if pinspec not in modules: - print "ERROR: spec type '%s' does not exist" % pinspec + print ("ERROR: spec type '%s' does not exist" % pinspec) printhelp() sys.exit(1) module = modules[pinspec] @@ -82,7 +82,7 @@ if __name__ == '__main__': else: gentypes = {'bsv': bsvgen} if output_type not in gentypes: - print "ERROR: output type '%s' does not exist" % output_type + print ("ERROR: output type '%s' does not exist" % output_type) printhelp() sys.exit(0) gentypes[output_type](output_dir, validate) diff --git a/src/spec/__init__.py b/src/spec/__init__.py index 9ec2d15..4f2db3d 100644 --- a/src/spec/__init__.py +++ b/src/spec/__init__.py @@ -1,5 +1,5 @@ -import m_class -import c_class +from spec import m_class +from spec import c_class from gen import specgen modules = {'m_class': m_class, diff --git a/src/spec/m_class.py b/src/spec/m_class.py index a43dc4a..be8ccb1 100644 --- a/src/spec/m_class.py +++ b/src/spec/m_class.py @@ -1,13 +1,13 @@ #!/usr/bin/env python -from interfaces import jtag, uart, ulpi, uartfull, rgbttl, rgmii -from interfaces import flexbus1, flexbus2, sdram1, sdram2, mcu8080 -from interfaces import eint, pwm, gpio, spi, i2c, emmc, sdmmc -from interfaces import quadspi, i2s -from interfaces import pinmerge, Pinouts +from spec.interfaces import jtag, uart, ulpi, uartfull, rgbttl, rgmii +from spec.interfaces import flexbus1, flexbus2, sdram1, sdram2, mcu8080 +from spec.interfaces import eint, pwm, gpio, spi, i2c, emmc, sdmmc +from spec.interfaces import quadspi, i2s +from spec.interfaces import pinmerge, Pinouts -from ifaceprint import display, display_fns, check_functions -from ifaceprint import display_fixed +from spec.ifaceprint import display, display_fns, check_functions +from spec.ifaceprint import display_fixed def pinspec(): @@ -137,18 +137,14 @@ def pinspec(): mmc2 = sdmmc(bankspec, "2", ('G', 28), "G", 2, start=2) pinmerge(pinouts, mmc2) - print "# Pinouts (PinMux)" - print - print "auto-generated by [[pinouts.py]]" - print - print "[[!toc ]]" - print - print pinouts.keys() + print ("""# Pinouts (PinMux) +auto-generated by [[pinouts.py]] + +[[!toc ]] +""") display(pinouts) - print - print "# Pinouts (Fixed function)" - print + print ("\n# Pinouts (Fixed function)\n") fixedpins = { 'DDR3': [ @@ -334,10 +330,10 @@ def pinspec(): fixedpins = display_fixed(fixedpins, len(pinouts)) - print "# Functions (PinMux)" - print - print "auto-generated by [[pinouts.py]]" - print + print ("""# Functions (PinMux) + +auto-generated by [[pinouts.py]] +""") function_names = {'EINT': 'External Interrupt', 'FB': 'MC68k FlexBus', @@ -679,18 +675,18 @@ def pinspec(): iot, iot_eint, iot_pwm, descriptions) - print "# Reference Datasheets" - print - print "datasheets and pinout links" - print - print "* " - print "* " - print "* " - print "* p8 " - print "* " - print "* " - print "* " - print "* ULPI OTG PHY, ST " - print "* ULPI OTG PHY, TI TUSB1210 " + print ("""# Reference Datasheets + +datasheets and pinout links +* +* +* +* p8 +* +* +* +* ULPI OTG PHY, ST +* ULPI OTG PHY, TI TUSB1210 +""") return pinouts, bankspec, fixedpins -- 2.30.2