Here are some editing that fix for me in my workflow Coinc, listed as follow:
Comment out debug print, as those interfere workflow's send feedback, use logger to debug
Remove the explicit env assignment for subprocess calling, as those are not necessary and wipe of Alfred ENVs in the subprocess
Use the builtin urllib instead of requests
I dropped the raise_for_status call, since it's an implicit default behavior in urllib.urlopen
Unlike most developer expected, I strongly discourage using any additional modules in workflow. As the installation gets very complicated for user that does not have adequate knowledge in dev. The worst scenario would be having multiple python instances of Python installed on device, and we have no clue of which pip is the user exactly using. Such cases are hard to diagnose and as workflow author, I wouldn't want to waste my time on solving this kind of environmental issues for user.
Here are some editing that fix for me in my workflow Coinc, listed as follow:
urllib
instead ofrequests
raise_for_status
call, since it's an implicit default behavior inurllib.urlopen
Unlike most developer expected, I strongly discourage using any additional modules in workflow. As the installation gets very complicated for user that does not have adequate knowledge in dev. The worst scenario would be having multiple python instances of Python installed on device, and we have no clue of which
pip
is the user exactly using. Such cases are hard to diagnose and as workflow author, I wouldn't want to waste my time on solving this kind of environmental issues for user.