Closed Hornbydd closed 4 years ago
@Hornbydd I appreciate your suggestion. However, I don't think it would be necessary to open the browser every time a WBT tool is being used. This can be problematic when users are calling a set of WBT tools using arcpy. Since the URLs are available on each tool dialog, uses can choose to view the source code if they wish. The ArcToolbox and WBT Runner provide similar functionalities.
@giswqs The enhancement I am suggesting is ONLY for your ViewCode tool in the About WhiteboxTools toolset, not ALL tools.
I would agree a web browser opening when you open any tool would be irritating. I'm suggesting a tweak to the tool that is specifically designed to give you a URL to the source code.
@Hornbydd Sorry, I misunderstood your point earlier. I just committed code that incorporates your suggestion. The View Code tool will now open a browser and navigate to the GitHub source code.
This is a useful tool that generates a URL for the source code but I would like to suggest it takes it one step further and actually take you to the web page. Why else would you use this tool if not for reviewing the code?
To make my suggestion work you would need to include the following import at the top of the file:
import webbrowser
Then replace the following code in the execute() function for the ViewCode class with the following:
A small tweak that would make this tool more helpful.