def main(): try: cli.main(standalone_mode=False) except CalledProcessError as e: tty.puterr("`{0}` failed with code {1}".format( " ".join(e.cmd), e.returncode )) except ParserError as e: tty.puterr("Error reading {0} at {1}: {2}".format( e.filetype, e.filepath, e.message )) except BrewMissingError as e: print("Next, install Homebrew (press any key to redirect)") click.getchar() urlopen(e.url) sys.exit(1) except (CiderException, click.ClickException) as e: tty.puterr(e.message, prefix="Error:") sys.exit(e.exit_code) except click.Abort: sys.stderr.write("Aborted!\n") sys.exit(1)
def main(): try: for i in theFile.read().splitlines(): urlopen(sfURL + i) print("Searched for " + i) print("\nDone!\n") except: print("Something went wrong, or user cancelled! Bailing out...")
#!/usr/bin/python from os import system from sys import argv from webbrowser import open as urlopen theFile = open(argv[1], 'r') sfURL = "https://na15.salesforce.com/_ui/search/ui/UnifiedSearchResults?str=" urlopen("https://login.salesforce.com" ) # need to MANUALLY log in first without SF's API system('clear') raw_input("Please log in to Salesforce. Press any key to continue.") def main(): try: for i in theFile.read().splitlines(): urlopen(sfURL + i) print("Searched for " + i) print("\nDone!\n") except: print("Something went wrong, or user cancelled! Bailing out...") if __name__ == "__main__": main()