def _current_data( self, text=None ): """ returns the current access point that the computer is connected to """ cmdoutput = toolbox.run( self._command_current_connection ) cmdoutput = cmdoutput.split( "\n" ) data = [ line.strip() for line in cmdoutput if line.strip().startswith( "SSID" ) and line.strip() != "" ] if data: data = data[0].split( ":" )[1].strip() if( data != "" ): return data else: #return "no access point" return False
def _current_data(self, text=None): """ returns the current access point that the computer is connected to """ cmdoutput = toolbox.run(self._command_current_connection) cmdoutput = cmdoutput.split("\n") data = [ line.strip() for line in cmdoutput if line.strip().startswith("SSID") and line.strip() != "" ] if data: data = data[0].split(":")[1].strip() if (data != ""): return data else: #return "no access point" return False
def pylint( self, text ): """ runs pylint on all the .py files in the current codebase, skips todo's and unused imports """ passed = [] e_raised = False for f in [ f for f in os.listdir( "." ) if f.endswith( ".py" ) ]: output = [ line for line in toolbox.run( "pylint "+f ).split("\n") if ("TODO" not in line and "Unused import" not in line and line.strip() != "" ) ] if len( output ) > 1: toprint = "\n".join( output ) if( "E:" in toprint ): e_raised = True print( toprint ) else: passed.append( f ) if e_raised: print( "*** ERRORS RAISED" ) return "The following files passed: {}".format( ", ".join( passed ) )