def open(self,string): # We will attempt to open the url try: webbrowser.open(string) except: print "%s: %s. \n\t%s" % (color.cyan('fu'), color.fail('Unable to Open Browser' ) , string)
def open(self, string): # We will attempt to open the url try: webbrowser.open(string) except: print "%s: %s. \n\t%s" % ( color.cyan('fu'), color.fail('Unable to Open Browser'), string)
def copy(self,string): # Assuming it works, we try and execute the function worked = True try: subprocess.Popen([self.copy_command], stdin=subprocess.PIPE).communicate(str(unicode(string))) except Exception, why: # If it doesn't work return flase worked = False print "%s: %s. The %s command failed" % ( color.cyan('fu'), color.fail('ERROR'), self.copy_command )
def copy(self, string): # Assuming it works, we try and execute the function worked = True try: subprocess.Popen(shlex.split(self.copy_command), stdin=subprocess.PIPE).communicate( str(unicode(string))) except Exception, why: # If it doesn't work return flase worked = False print "%s: %s. The %s command failed" % ( color.cyan('fu'), color.fail('ERROR'), self.copy_command)