Exemple #1
0
def make_quest_info(name, data):
    """Return an HTML summary of a quest from its data."""
    info = ""
    info += "<b>%s</b><br>" % name
    info += "%s<br><br>" % text_to_html(data["title"])
    info += "%s<br><br>" % text_to_html(data["fullText"])
    info += "<b>Pixels:</b> %s" % data["money"]
    return info
Exemple #2
0
def make_quest_info(name, data):
    """Return an HTML summary of a quest from its data."""
    info = ""
    info += "<b>%s</b><br>" % name
    info += "%s<br><br>" % text_to_html(data["title"])
    info += "%s<br><br>" % text_to_html(data["fullText"])
    info += "<b>Pixels:</b> %s" % data["money"]
    return info
def generate_item_info(item_data):
    """Takes inventory item data and makes a detailed description (HTML)."""
    info = ""

    if item_data is None:
        return ""

    for fmt in data_format:
        if fmt[0] in item_data:
            try:
                if type(fmt[1]) is str:
                    info += fmt[1] % text_to_html(str(item_data[fmt[0]]))
                else:
                    info += fmt[1](item_data[fmt[0]])
            except:
                logging.exception("Error parsing %s key", fmt[0])

    return info
Exemple #4
0
def generate_item_info(item_data):
    """Takes inventory item data and makes a detailed description (HTML)."""
    info = ""

    if item_data is None:
        return ""

    for fmt in data_format:
        if fmt[0] in item_data:
            try:
                if type(fmt[1]) is str:
                    info += fmt[1] % text_to_html(str(item_data[fmt[0]]))
                else:
                    info += fmt[1](item_data[fmt[0]])
            except:
                logging.exception("Error parsing %s key", fmt[0])

    return info