コード例 #1
0
def record_correct_template():

    briefing_template = "We could find the API server " + code("TXT record")
    briefing_template += " for " + bold("{{domain_url}}") + "!"
    message_template = "Congratulations! " + briefing_template + breakline()
    message_template += breakline() + "This is your record:" + breakline()
    message_template += code_block("{{&record}}")
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #2
0
def no_record_template():

    briefing_template = "Could not find the API server " + code("TXT record")
    briefing_template += " for " + bold("{{domain_url}}") + "!"
    message_template = briefing_template + breakline()
    message_template += "Please add one in your DNS settings." + breakline()
    message_template += "Refer to the " + link("install instructions",
        "http://buddycloud.com/install#buddycloud_dns_") + " for more info."
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #3
0
def xmpp_disco_query_send_error_template():

    briefing_template = "Could not send " + code("{{disco_type}}") + " query"
    briefing_template += " to " + bold("{{xmpp_server}}") + "."
    message_template = briefing_template + breakline() + "Beware it may not "
    message_template += "be a problem with domain " + bold("{{domain_url}}")
    message_template += " or the XMPP server at " + bold("{{xmpp_server}}")
    message_template += "." + breakline() + "{{#error}}Problem: {{error}}{{/"
    message_template += "error}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #4
0
def xmpp_disco_query_send_error_template():

    briefing_template = "Could not send " + code("{{disco_type}}") + " query"
    briefing_template += " to " + bold("{{xmpp_server}}") + "."
    message_template = briefing_template + breakline() + "Beware it may not "
    message_template += "be a problem with domain " + bold("{{domain_url}}")
    message_template += " or the XMPP server at " + bold("{{xmpp_server}}")
    message_template += "." + breakline() + "{{#error}}Problem: {{error}}{{/"
    message_template += "error}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #5
0
def record_error_template():

    briefing_template = "We could find the API server " + code("TXT record")
    briefing_template += " for " + bold("{{domain_url}}")
    briefing_template += " but it is problematic!"
    message_template = briefing_template + breakline()
    message_template += breakline() + "This is your record:" + breakline()
    message_template += code_block("{{&record}}")
    message_template += "{{&error}}" + breakline()
    message_template += "Please fix this in your DNS settings." + breakline()
    message_template += "Refer to the " + link("install instructions",
        "http://buddycloud.com/install#buddycloud_dns_") + " for more info."
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #6
0
def buddycloud_enabled_conflict_template():

    briefing_template = bold("{{domain_url}}") + " is "
    briefing_template += italic("buddycloud enabled") + ","
    briefing_template += " but we detected a conflict problem."
    message_template = briefing_template + breakline()
    message_template += "Using " + code("Service Discovery")
    message_template += ", we found your channel server at "
    message_template += bold("{{channel_server}}") + "!" + breakline()
    message_template += "But we also found a channel server through "
    message_template += code("TXT record lookup") + ", which is different: "
    message_template += bold("{{channel_server2}}") + "!" + breakline()
    message_template += "The channel server addresses found through "
    message_template += code("Service Discovery") + " and " + code("TXT record lookup") + " must match!"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #7
0
def xmpp_connection_problem_template():

    briefing_template = "Could not establish a client XMPP connection."
    message_template = briefing_template + breakline() + "Beware it is NOT a"
    message_template += " problem with domain " + bold("{{domain_url}}")+ "."
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #8
0
def is_buddycloud_enabled_template():

    briefing_template = bold("{{domain_url}}") + " is "
    briefing_template += italic("buddycloud enabled") + "."
    message_template = "Congratulations! " + briefing_template + breakline()
    message_template += "{{#discovery}}Using " + code("Service Discovery")
    message_template += ", we found your channel server at "
    message_template += bold("{{channel_server}}") + "!" + breakline()
    message_template += "{{#ptr_record}}We also found your channel server "
    message_template += code("PTR record") + ".{{/ptr_record}}{{/discovery}}"
    message_template += "{{#ptr_record}}Using " + code("PTR record") + ", we"
    message_template += " found your channel server at "
    message_template += bold("{{channel_server}}") + "!" + breakline() + "Bu"
    message_template += "t we could not find it through "
    message_template += code("Service Discovery") + ".{{/ptr_record}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #9
0
def is_buddycloud_enabled_template():

    briefing_template = bold("{{domain_url}}") + " is "
    briefing_template += italic("buddycloud enabled") + "."
    message_template = "Congratulations! " + briefing_template + breakline()
    message_template += "{{#discovery}}Using " + code("Service Discovery")
    message_template += ", we found your channel server at "
    message_template += bold("{{channel_server}}") + "!" + breakline()
    message_template += "{{#ptr_record}}We also found your channel server "
    message_template += code("PTR record") + ".{{/ptr_record}}{{/discovery}}"
    message_template += "{{#ptr_record}}Using " + code("PTR record") + ", we"
    message_template += " found your channel server at "
    message_template += bold("{{channel_server}}") + "!" + breakline() + "Bu"
    message_template += "t we could not find it through "
    message_template += code("Service Discovery") + ".{{/ptr_record}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #10
0
def xmpp_server_error_template():

    briefing_template = "The {{disco_type}} query got an error response from"
    briefing_template += " " + bold("{{xmpp_server}}") + "."
    message_template = briefing_template + breakline() + "The XMPP server at"
    message_template += " " + bold("{{xmpp_server}}") + " returned the follo"
    message_template += "wing error: " + code("{{&error}}")
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #11
0
def xmpp_server_error_template():

    briefing_template = "The {{disco_type}} query got an error response from"
    briefing_template += " " + bold("{{xmpp_server}}") + "."
    message_template = briefing_template + breakline() + "The XMPP server at"
    message_template += " " + bold("{{xmpp_server}}") + " returned the follo"
    message_template += "wing error: " + code("{{&error}}")
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #12
0
def xmpp_connection_problem_template():

    briefing_template = "Could not establish a XMPP connection to "
    briefing_template += bold("{{xmpp_server}}") + "."
    message_template = briefing_template + breakline() + "Beware it is NOT a"
    message_template += " problem with domain " + bold("{{domain_url}}")
    message_template += " nor the XMPP server at " + bold("{{xmpp_server}}")
    message_template += "."
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #13
0
def xmpp_connection_problem_template():

    briefing_template = "Could not establish a XMPP connection to "
    briefing_template += bold("{{xmpp_server}}") + "."
    message_template = briefing_template + breakline() + "Beware it is NOT a"
    message_template += " problem with domain " + bold("{{domain_url}}")
    message_template += " nor the XMPP server at " + bold("{{xmpp_server}}")
    message_template += "."
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #14
0
def xmpp_disco_query_send_error_template():

    briefing_template = "Could not send "+code("{{disco_type}}")+" query to "
    briefing_template += "{{^xmpp_server}}" + bold("{{domain_url}}")
    briefing_template += "{{/xmpp_server}}"
    briefing_template += "{{#xmpp_server}}" + bold("{{xmpp_server}}")
    briefing_template += "{{/xmpp_server}}."
    message_template = briefing_template
    message_template += "{{#error}}" + breakline()
    message_template += "Error response: " + code("{{&error}}") +"{{/error}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #15
0
def xmpp_server_error_template():

    briefing_template = "The {{disco_type}} query got an error response from"
    briefing_template += "{{^xmpp_server}}" + bold("{{domain_url}}")
    briefing_template += "{{/xmpp_server}}"
    briefing_template += "{{#xmpp_server}}" + bold("{{xmpp_server}}")
    briefing_template += "{{/xmpp_server}}."
    message_template = briefing_template
    message_template += "{{#error}}" + breakline()
    message_template += "Error response: " + code("{{&error}}") +"{{/error}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #16
0
def multiple_problems_template():

    briefing_template = "No xmpp server found is "
    briefing_template += italic("buddycloud enabled") + "."
    message_template = briefing_template + breakline() + "Several problems w"
    message_template += "ith XMPP servers found: " + breakline() + breakline()
    message_template += "{{#xmpp_servers}}" + bold("{{name}}:") + breakline()
    message_template += "{{&error}}" + breakline() + breakline() + "{{/xmpp_"
    message_template += "servers}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #17
0
def multiple_problems_template():

    briefing_template = "No xmpp server found is "
    briefing_template += italic("buddycloud enabled") + "."
    message_template = briefing_template + breakline() + "Several problems w"
    message_template += "ith XMPP servers found: " + breakline() + breakline()
    message_template += "{{#xmpp_servers}}" + bold("{{name}}:") + breakline()
    message_template += "{{&error}}" + breakline() + breakline() + "{{/xmpp_"
    message_template += "servers}}"
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template
コード例 #18
0
def record_error_template():

    briefing_template = "We could find the Buddycloud server " + code("TXT record")
    briefing_template += " for " + bold("{{domain_url}}")
    briefing_template += " but it is problematic!"
    message_template = briefing_template + breakline()
    message_template += breakline() + "This is your record:" + breakline()
    message_template += code_block("{{&record}}")
    message_template += breakline() + "{{&error}}" + breakline()
    message_template += "Please fix this in your DNS settings." + breakline()
    message_template += "Refer to this " + link("document",
        "http://buddycloud.github.io/buddycloud-xep/#DNS-discovery") + " for more info."
    briefing_template = parse(briefing_template)
    message_template = parse(message_template)
    return briefing_template, message_template