コード例 #1
0
# -*- coding: utf-8 -*-
# Created by http://www.reddit.com/user/toshitalk
# Released under GPL.

# import standard libraries
import os
import sys

from conn import download_data
from excel import write_data
from excel import select_excel
from calculations import get_data
from calculations import get_values


if __name__ == "__main__":
    data = download_data()

    try:
        tool_file = sys.argv[1]
    except IndexError:
        tool_file = select_excel()

    tool_path = os.path.join(os.getcwd(), tool_file)

    # currently only using stats.
    # actives and passives to be implemented later.
    stats, actives, passives = get_data(data)
    data = get_values(stats)
    write_data(tool_path, data)
コード例 #2
0
from calculations import Stat
from calculations import get_owe
from calculations import get_data
from calculations import parse_item
from calculations import is_shield

if __name__ == "__main__":
    # initialize storage
    workbook = select_excel()

    # download content
    content = download_content()
    owe = get_owe(content)

    # grab each item
    for slot, item in get_data(content):
        attributes = parse_item(item, owe)

        # if offhand is shield, set accordingly
        if slot == "offhand":
            if is_shield(item):
                slot = "shield"

        if slot == "pants":
            pprint.pprint(item)

        # for each item, grab each attribute
        for attribute, value in attributes.items():
            cellname = "{}-{}".format(slot, attribute)
            try:
                cells[cellname] = Stat(cells[cellname].cell, value)