Example #1
0
		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)
Example #2
0
    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)
Example #3
0
		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 ) 
Example #4
0
    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)