Skip to content

Instantly share code, notes, and snippets.

@nightlyone
Created July 10, 2013 11:05
Show Gist options
  • Save nightlyone/5965415 to your computer and use it in GitHub Desktop.
Save nightlyone/5965415 to your computer and use it in GitHub Desktop.
python parsing
#!/usr/bin/env python
class Options:
critical_host = 'python.example.com'
service_state = "OK"
description = "parsing works"
long_output = "Yeah, I can still python"
options = Options()
comment_template_plain ="{{{ \n[" + options.critical_host + "] " + options.service_state + ": " + options.description + "\n" + options.long_output + "\n}}}"
comment_template_res = """{{{
[%s] %s: %s
%s
}}}""" % (options.critical_host, options.service_state, options.description, options.long_output)
print comment_template_res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment