Created
July 10, 2013 11:05
-
-
Save nightlyone/5965415 to your computer and use it in GitHub Desktop.
python parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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