@@ -72,7 +72,6 @@ def print_usage(error=None):
7272
7373 # Options for GPIO mode
7474 elif (len (sys .argv ) > 1 ) and (sys .argv [1 ] == 'gpio' ):
75-
7675 print ('<options> gpio options:' )
7776 print ('' )
7877 print (' mode - GPIO numbering mode, either BOARD or BCM' )
@@ -98,7 +97,6 @@ def print_usage(error=None):
9897 )
9998 # Options for PIGPIO mode
10099 elif (len (sys .argv ) > 1 ) and (sys .argv [1 ] == 'pigpio' ):
101-
102100 print ('<options> pigpio options:' )
103101 print ('' )
104102 print (' host - Host name of the Pi on which the pigpio daemon is running.' )
@@ -142,11 +140,11 @@ def print_usage(error=None):
142140
143141
144142def options_pop (value , default = no_default ):
145- ''' Pops value from options with error checking
143+ """ Pops value from options with error checking
146144 value: which option to pop and check.
147145 default: optional, sets a default if not defined.
148146 returns: a string corresponding to the option on the command line
149- '''
147+ """
150148 global options
151149 try :
152150 # If no default value is defined
@@ -161,7 +159,7 @@ def options_pop(value, default=no_default):
161159 except Exception as e :
162160 raise e
163161 if return_value == '' :
164- print_usage (' Option %s can\ ' t be blank.' % value )
162+ print_usage (" Option %s can't be blank." % value )
165163 return return_value
166164
167165
@@ -184,7 +182,6 @@ def run():
184182 rows = int (options_pop ('rows' ))
185183 charmap = options_pop ('charmap' , 'A00' )
186184 if lcdmode == 'i2c' :
187-
188185 from RPLCD import i2c
189186
190187 if len (sys .argv ) < 5 :
@@ -210,7 +207,6 @@ def run():
210207 'or device not connected properly'
211208 )
212209 elif lcdmode == 'gpio' :
213-
214210 import RPi .GPIO as GPIO
215211 from RPLCD import gpio
216212
@@ -251,7 +247,6 @@ def run():
251247 charmap = charmap ,
252248 )
253249 elif lcdmode == 'pigpio' :
254-
255250 from pigpio import pi
256251 from RPLCD import pigpio
257252
@@ -308,4 +303,4 @@ def run():
308303 else :
309304 print_usage ('%sx%s displays are not supported in this test.' % (cols , rows ))
310305 else :
311- print_usage (' Test \ ' %s\ ' is not supported.' % test )
306+ print_usage (" Test '%s' is not supported." % test )
0 commit comments