Skip to content

Instantly share code, notes, and snippets.

@robert-chiniquy
Created June 8, 2017 13:42
Show Gist options
  • Save robert-chiniquy/cc66a57ecc06ff8165cdec85c13f084d to your computer and use it in GitHub Desktop.
Save robert-chiniquy/cc66a57ecc06ff8165cdec85c13f084d to your computer and use it in GitHub Desktop.
for mckraken
#! /usr/bin/env python
import subprocess
import syslog
import sys
import os
def open_sft_url_handler(url_string):
syslog.syslog("ScaleFT: Opening URL: " + url_string)
try:
subprocess.check_call(["sft", "_url_handler", url_string])
except Exception, e:
syslog.syslog("ScaleFT: Opening URL Failed: " + str(e))
sys.stderr.write("ScaleFT: Opening URL Failed: " + str(e) + "\n")
sys.exit(1)
if __name__ == "__main__":
url_string = sys.argv[1]
open_sft_url_handler(url_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment