import requests from core import constants, itemdata from util.printutil import ProgressBar import time from core.config import Config from core.itemdata import Category from requests.exceptions import Timeout from util import utils from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry # _config _config = Config() _section_market = _config.addSection("Warframe Market") _section_market.addEntry("BATCH_INTERVAL", 30, "How long to wait between two batches (in seconds)") _section_market.addEntry( "BATCH_SIZE", 200, "The size of each batch (the number of items/urls) when requesting market.market data" ) _section_market.addEntry( "MAX_CONNECTIONS", 30, "The maximum number of simultaneous threads for http-requests") _section_market.addEntry( "MAX_ORDER_AGE", 4, "Only include orders of players that are either in-game, or that have been updated in the last X hours" ) _section_market.addEntry( "MAX_UPDATE_AGE", 8,
from _io import StringIO import ctypes import platform import sys import traceback import os from core.config import Config, FunctionBlock from core import constants from market import instance config = Config() section_funcs = config.addSection("Functions") section_funcs.addEntry( "calc_buy_repr", FunctionBlock( r'''if not prices["buy"]: sell_repr = calc_sell_repr(prices) return sell_repr * 3 // 4 if sell_repr else None else: # for buying only include the most expensive 10% n = int(len(prices["buy"]) * 0.1 + 0.95) return sum(prices["buy"][:n]) // n''', "prices"), "calculates a buy-price-representative from price-data for a single component" ) section_funcs.addEntry( "calc_sell_repr", FunctionBlock( r'''if not prices["sell"]: