diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..a44fd78 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run Tests + run: | + python validate.py test diff --git a/README.md b/README.md index d6f8768..a36dd0f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ must contain all possible interactions and unique off-chain analytics tag. scoring formula, etc.. * [ScoreModel](./models/scores.py) - final formula to get scores for each project based on metrics +Every project must have an icon, icon must be present in the [projects/icons](projects/icons) folder. +Icon name template is ``{leaderboard}_{project_name}.{extension}``, where: +* __leaderboard__ - value from ``SeasonConfig.leaderboard`` +* __project_name__ - project name (``Project.name``), in lower-case +* __extension__ - svg or png. In case of png size must be 100x100 px. + ## Season List of the seasons supported with the leaderboard links diff --git a/models/icons.py b/models/icons.py new file mode 100644 index 0000000..107e940 --- /dev/null +++ b/models/icons.py @@ -0,0 +1,16 @@ +import glob +import os + +from models.season_config import SeasonConfig + + +def get_icon_name(config: SeasonConfig, project: any): + # start with detecing icon extension + prefix = config.leaderboard + "_" + project.name.lower() + icons = glob.glob(f"{os.path.dirname(os.path.realpath(__file__))}/../projects/icons/{prefix}.*") + if len(icons) == 0: + raise Exception(f"No icon found for {project.name}") + if len(icons) > 1: + raise Exception(f"Multiple icon formats found for {project.name}") + format = icons[0].split(".")[-1] + return prefix + '.' + format \ No newline at end of file diff --git a/models/render_method.py b/models/render_method.py index bf5ebf8..c246d16 100644 --- a/models/render_method.py +++ b/models/render_method.py @@ -1,10 +1,13 @@ +import glob +import os from decimal import Decimal import pandas as pd import time from datetime import datetime -from models.results import CalculationResults +from models.icons import get_icon_name +from models.results import CalculationResults, ProjectStat import json import pathlib import git @@ -15,6 +18,9 @@ Method to render results """ class RenderMethod: + def __init__(self, icons_base_path): + self.icons_base_path = icons_base_path + def render(self, res: CalculationResults, config: SeasonConfig): raise NotImplemented() @@ -22,12 +28,22 @@ def get_commit_hash(self): repo = git.Repo(search_parent_directories=True, path=pathlib.Path(__file__).parent.resolve()) return repo.head.object.hexsha - def get_items(self, res: CalculationResults): + def get_icon(self, project: ProjectStat, config: SeasonConfig): + icon_name = get_icon_name(config, project) + if self.icons_base_path: + return self.icons_base_path + icon_name + else: + return icon_name + + + + def get_items(self, res: CalculationResults, config: SeasonConfig): items = [] for item in res.ranking: obj = { 'name': item.name, - 'score': item.score + 'score': item.score, + 'icon': self.get_icon(item, config) } for k, v in item.metrics.items(): obj[k] = float(v) if type(v) == Decimal else v @@ -36,11 +52,13 @@ def get_items(self, res: CalculationResults): class JsonRenderMethod(RenderMethod): - def __init__(self, output_name): + + def __init__(self, output_name, icons_base_path=None): + RenderMethod.__init__(self, icons_base_path) self.output_name = output_name def render(self, res: CalculationResults, config: SeasonConfig): - items = self.get_items(res) + items = self.get_items(res, config) res = { 'update_time': res.build_time, 'build_time': int(time.time()), @@ -52,11 +70,12 @@ def render(self, res: CalculationResults, config: SeasonConfig): json.dump(res, out, indent=True) class HTMLRenderMethod(RenderMethod): - def __init__(self, output_name): + def __init__(self, output_name, icons_base_path=None): + RenderMethod.__init__(self, icons_base_path) self.output_name = output_name def render(self, res: CalculationResults, config: SeasonConfig): - items = self.get_items(res) + items = self.get_items(res, config) table = pd.DataFrame(items).to_html() with open(self.output_name, "wt") as out: out.write(f"
Results for {config.name}") diff --git a/projects/icons/apps_arbuz.png b/projects/icons/apps_arbuz.png new file mode 100644 index 0000000..6a36b9f Binary files /dev/null and b/projects/icons/apps_arbuz.png differ diff --git a/projects/icons/apps_catizen.png b/projects/icons/apps_catizen.png new file mode 100644 index 0000000..273c57b Binary files /dev/null and b/projects/icons/apps_catizen.png differ diff --git a/projects/icons/apps_cheques corp.png b/projects/icons/apps_cheques corp.png new file mode 100644 index 0000000..c304bb0 Binary files /dev/null and b/projects/icons/apps_cheques corp.png differ diff --git a/projects/icons/apps_chick coop.png b/projects/icons/apps_chick coop.png new file mode 100644 index 0000000..c977c44 Binary files /dev/null and b/projects/icons/apps_chick coop.png differ diff --git a/projects/icons/apps_fanton.svg b/projects/icons/apps_fanton.svg new file mode 100644 index 0000000..a0f64d8 --- /dev/null +++ b/projects/icons/apps_fanton.svg @@ -0,0 +1,22 @@ + diff --git a/projects/icons/apps_fanzee.svg b/projects/icons/apps_fanzee.svg new file mode 100644 index 0000000..9657c90 --- /dev/null +++ b/projects/icons/apps_fanzee.svg @@ -0,0 +1,10 @@ + diff --git a/projects/icons/apps_gatto.png b/projects/icons/apps_gatto.png new file mode 100644 index 0000000..252c772 Binary files /dev/null and b/projects/icons/apps_gatto.png differ diff --git a/projects/icons/apps_getgems.svg b/projects/icons/apps_getgems.svg new file mode 100644 index 0000000..addfd2b --- /dev/null +++ b/projects/icons/apps_getgems.svg @@ -0,0 +1,15 @@ + diff --git a/projects/icons/apps_gm.png b/projects/icons/apps_gm.png new file mode 100644 index 0000000..667a934 Binary files /dev/null and b/projects/icons/apps_gm.png differ diff --git a/projects/icons/apps_gram.svg b/projects/icons/apps_gram.svg new file mode 100644 index 0000000..c0548ff --- /dev/null +++ b/projects/icons/apps_gram.svg @@ -0,0 +1,4 @@ + diff --git a/projects/icons/apps_jetton.png b/projects/icons/apps_jetton.png new file mode 100644 index 0000000..3927bb4 Binary files /dev/null and b/projects/icons/apps_jetton.png differ diff --git a/projects/icons/apps_play wallet.png b/projects/icons/apps_play wallet.png new file mode 100644 index 0000000..9f316aa Binary files /dev/null and b/projects/icons/apps_play wallet.png differ diff --git a/projects/icons/apps_playwallet.png b/projects/icons/apps_playwallet.png new file mode 100644 index 0000000..9f316aa Binary files /dev/null and b/projects/icons/apps_playwallet.png differ diff --git a/projects/icons/apps_quackquack.png b/projects/icons/apps_quackquack.png new file mode 100644 index 0000000..25ddb55 Binary files /dev/null and b/projects/icons/apps_quackquack.png differ diff --git a/projects/icons/apps_shardify.png b/projects/icons/apps_shardify.png new file mode 100644 index 0000000..f5c1df4 Binary files /dev/null and b/projects/icons/apps_shardify.png differ diff --git a/projects/icons/apps_squidtg.png b/projects/icons/apps_squidtg.png new file mode 100644 index 0000000..188b9b0 Binary files /dev/null and b/projects/icons/apps_squidtg.png differ diff --git a/projects/icons/apps_swap.coffee.png b/projects/icons/apps_swap.coffee.png new file mode 100644 index 0000000..ced65ca Binary files /dev/null and b/projects/icons/apps_swap.coffee.png differ diff --git a/projects/icons/apps_tap fantasy.png b/projects/icons/apps_tap fantasy.png new file mode 100644 index 0000000..369a264 Binary files /dev/null and b/projects/icons/apps_tap fantasy.png differ diff --git a/projects/icons/apps_the pixels.png b/projects/icons/apps_the pixels.png new file mode 100644 index 0000000..55179d6 Binary files /dev/null and b/projects/icons/apps_the pixels.png differ diff --git a/projects/icons/apps_the royal fortress.png b/projects/icons/apps_the royal fortress.png new file mode 100644 index 0000000..c93c09b Binary files /dev/null and b/projects/icons/apps_the royal fortress.png differ diff --git a/projects/icons/apps_ton punks.svg b/projects/icons/apps_ton punks.svg new file mode 100644 index 0000000..0bf66a7 --- /dev/null +++ b/projects/icons/apps_ton punks.svg @@ -0,0 +1,15 @@ + diff --git a/projects/icons/apps_ton raffles.svg b/projects/icons/apps_ton raffles.svg new file mode 100644 index 0000000..7689296 --- /dev/null +++ b/projects/icons/apps_ton raffles.svg @@ -0,0 +1,5 @@ + diff --git a/projects/icons/apps_tonano.png b/projects/icons/apps_tonano.png new file mode 100644 index 0000000..99bca16 Binary files /dev/null and b/projects/icons/apps_tonano.png differ diff --git a/projects/icons/apps_tongochi.png b/projects/icons/apps_tongochi.png new file mode 100644 index 0000000..d020947 Binary files /dev/null and b/projects/icons/apps_tongochi.png differ diff --git a/projects/icons/apps_tonsoffriends.png b/projects/icons/apps_tonsoffriends.png new file mode 100644 index 0000000..7883c60 Binary files /dev/null and b/projects/icons/apps_tonsoffriends.png differ diff --git a/projects/icons/apps_tonup.svg b/projects/icons/apps_tonup.svg new file mode 100644 index 0000000..13b60fd --- /dev/null +++ b/projects/icons/apps_tonup.svg @@ -0,0 +1,4 @@ + diff --git a/projects/icons/apps_xplus.png b/projects/icons/apps_xplus.png new file mode 100644 index 0000000..777ee32 Binary files /dev/null and b/projects/icons/apps_xplus.png differ diff --git a/projects/icons/apps_xrare.png b/projects/icons/apps_xrare.png new file mode 100644 index 0000000..353875e Binary files /dev/null and b/projects/icons/apps_xrare.png differ diff --git a/projects/icons/apps_yescoin.png b/projects/icons/apps_yescoin.png new file mode 100644 index 0000000..4fa5c35 Binary files /dev/null and b/projects/icons/apps_yescoin.png differ diff --git a/projects/icons/defi_daolama.png b/projects/icons/defi_daolama.png new file mode 100644 index 0000000..473d06b Binary files /dev/null and b/projects/icons/defi_daolama.png differ diff --git a/projects/icons/defi_dedust.svg b/projects/icons/defi_dedust.svg new file mode 100644 index 0000000..73a8dfc --- /dev/null +++ b/projects/icons/defi_dedust.svg @@ -0,0 +1,56 @@ + diff --git a/projects/icons/defi_evaa.svg b/projects/icons/defi_evaa.svg new file mode 100644 index 0000000..fd52f32 --- /dev/null +++ b/projects/icons/defi_evaa.svg @@ -0,0 +1,6 @@ + diff --git a/projects/icons/defi_ston.fi.svg b/projects/icons/defi_ston.fi.svg new file mode 100644 index 0000000..9434690 --- /dev/null +++ b/projects/icons/defi_ston.fi.svg @@ -0,0 +1,10 @@ + diff --git a/projects/icons/defi_storm trade.png b/projects/icons/defi_storm trade.png new file mode 100644 index 0000000..fa1d287 Binary files /dev/null and b/projects/icons/defi_storm trade.png differ diff --git a/projects/icons/defi_tradoor.png b/projects/icons/defi_tradoor.png new file mode 100644 index 0000000..22ed012 Binary files /dev/null and b/projects/icons/defi_tradoor.png differ diff --git a/projects/icons/nfts_animals red list.png b/projects/icons/nfts_animals red list.png new file mode 100644 index 0000000..2e3339a Binary files /dev/null and b/projects/icons/nfts_animals red list.png differ diff --git a/projects/icons/nfts_fanton fantasy football.png b/projects/icons/nfts_fanton fantasy football.png new file mode 100644 index 0000000..bb68328 Binary files /dev/null and b/projects/icons/nfts_fanton fantasy football.png differ diff --git a/projects/icons/nfts_g-bots sd.png b/projects/icons/nfts_g-bots sd.png new file mode 100644 index 0000000..3e4254d Binary files /dev/null and b/projects/icons/nfts_g-bots sd.png differ diff --git a/projects/icons/nfts_gatto.png b/projects/icons/nfts_gatto.png new file mode 100644 index 0000000..a1d7f69 Binary files /dev/null and b/projects/icons/nfts_gatto.png differ diff --git a/projects/icons/nfts_glitches.png b/projects/icons/nfts_glitches.png new file mode 100644 index 0000000..fc505fc Binary files /dev/null and b/projects/icons/nfts_glitches.png differ diff --git a/projects/icons/nfts_market makers.png b/projects/icons/nfts_market makers.png new file mode 100644 index 0000000..1b8a26e Binary files /dev/null and b/projects/icons/nfts_market makers.png differ diff --git a/projects/icons/nfts_nft web3ton.png b/projects/icons/nfts_nft web3ton.png new file mode 100644 index 0000000..29c15b3 Binary files /dev/null and b/projects/icons/nfts_nft web3ton.png differ diff --git a/projects/icons/nfts_not punks.png b/projects/icons/nfts_not punks.png new file mode 100644 index 0000000..71620db Binary files /dev/null and b/projects/icons/nfts_not punks.png differ diff --git a/projects/icons/nfts_parachute.png b/projects/icons/nfts_parachute.png new file mode 100644 index 0000000..56e5258 Binary files /dev/null and b/projects/icons/nfts_parachute.png differ diff --git a/projects/icons/nfts_povel durev nft.png b/projects/icons/nfts_povel durev nft.png new file mode 100644 index 0000000..6f128d4 Binary files /dev/null and b/projects/icons/nfts_povel durev nft.png differ diff --git a/projects/icons/nfts_roolz.png b/projects/icons/nfts_roolz.png new file mode 100644 index 0000000..bd1d6fe Binary files /dev/null and b/projects/icons/nfts_roolz.png differ diff --git a/projects/icons/nfts_runeston.png b/projects/icons/nfts_runeston.png new file mode 100644 index 0000000..8d3cbd0 Binary files /dev/null and b/projects/icons/nfts_runeston.png differ diff --git a/projects/icons/nfts_smeshariki.png b/projects/icons/nfts_smeshariki.png new file mode 100644 index 0000000..1599626 Binary files /dev/null and b/projects/icons/nfts_smeshariki.png differ diff --git a/projects/icons/nfts_the miners club nfts.png b/projects/icons/nfts_the miners club nfts.png new file mode 100644 index 0000000..88920e5 Binary files /dev/null and b/projects/icons/nfts_the miners club nfts.png differ diff --git a/projects/icons/nfts_ton diamonds.png b/projects/icons/nfts_ton diamonds.png new file mode 100644 index 0000000..f7b579c Binary files /dev/null and b/projects/icons/nfts_ton diamonds.png differ diff --git a/projects/icons/nfts_ton fish box.png b/projects/icons/nfts_ton fish box.png new file mode 100644 index 0000000..117859d Binary files /dev/null and b/projects/icons/nfts_ton fish box.png differ diff --git a/projects/icons/nfts_ton frogs.png b/projects/icons/nfts_ton frogs.png new file mode 100644 index 0000000..69d4bb6 Binary files /dev/null and b/projects/icons/nfts_ton frogs.png differ diff --git a/projects/icons/nfts_ton punks.png b/projects/icons/nfts_ton punks.png new file mode 100644 index 0000000..d924ff5 Binary files /dev/null and b/projects/icons/nfts_ton punks.png differ diff --git a/projects/icons/nfts_ton sharks.png b/projects/icons/nfts_ton sharks.png new file mode 100644 index 0000000..fc2bce9 Binary files /dev/null and b/projects/icons/nfts_ton sharks.png differ diff --git a/projects/icons/nfts_tonalchemists magic potions.png b/projects/icons/nfts_tonalchemists magic potions.png new file mode 100644 index 0000000..801063c Binary files /dev/null and b/projects/icons/nfts_tonalchemists magic potions.png differ diff --git a/projects/icons/nfts_toned ape club!.png b/projects/icons/nfts_toned ape club!.png new file mode 100644 index 0000000..410f683 Binary files /dev/null and b/projects/icons/nfts_toned ape club!.png differ diff --git a/projects/icons/nfts_yng explrz.png b/projects/icons/nfts_yng explrz.png new file mode 100644 index 0000000..81c2cab Binary files /dev/null and b/projects/icons/nfts_yng explrz.png differ diff --git a/projects/icons/tokens_$tol.png b/projects/icons/tokens_$tol.png new file mode 100644 index 0000000..d4e6186 Binary files /dev/null and b/projects/icons/tokens_$tol.png differ diff --git a/projects/icons/tokens_1rusd.png b/projects/icons/tokens_1rusd.png new file mode 100644 index 0000000..5dbc688 Binary files /dev/null and b/projects/icons/tokens_1rusd.png differ diff --git a/projects/icons/tokens_@btc25.png b/projects/icons/tokens_@btc25.png new file mode 100644 index 0000000..82c160f Binary files /dev/null and b/projects/icons/tokens_@btc25.png differ diff --git a/projects/icons/tokens_alenka.png b/projects/icons/tokens_alenka.png new file mode 100644 index 0000000..d2d0dfc Binary files /dev/null and b/projects/icons/tokens_alenka.png differ diff --git a/projects/icons/tokens_anon.png b/projects/icons/tokens_anon.png new file mode 100644 index 0000000..2835eed Binary files /dev/null and b/projects/icons/tokens_anon.png differ diff --git a/projects/icons/tokens_arbuz.png b/projects/icons/tokens_arbuz.png new file mode 100644 index 0000000..6a36b9f Binary files /dev/null and b/projects/icons/tokens_arbuz.png differ diff --git a/projects/icons/tokens_bear.png b/projects/icons/tokens_bear.png new file mode 100644 index 0000000..8da2178 Binary files /dev/null and b/projects/icons/tokens_bear.png differ diff --git a/projects/icons/tokens_bolt.png b/projects/icons/tokens_bolt.png new file mode 100644 index 0000000..9b7185a Binary files /dev/null and b/projects/icons/tokens_bolt.png differ diff --git a/projects/icons/tokens_burn.png b/projects/icons/tokens_burn.png new file mode 100644 index 0000000..178f259 Binary files /dev/null and b/projects/icons/tokens_burn.png differ diff --git a/projects/icons/tokens_cats.png b/projects/icons/tokens_cats.png new file mode 100644 index 0000000..4f49785 Binary files /dev/null and b/projects/icons/tokens_cats.png differ diff --git a/projects/icons/tokens_ces.png b/projects/icons/tokens_ces.png new file mode 100644 index 0000000..ced65ca Binary files /dev/null and b/projects/icons/tokens_ces.png differ diff --git a/projects/icons/tokens_cofe.png b/projects/icons/tokens_cofe.png new file mode 100644 index 0000000..aadb41c Binary files /dev/null and b/projects/icons/tokens_cofe.png differ diff --git a/projects/icons/tokens_crypton.png b/projects/icons/tokens_crypton.png new file mode 100644 index 0000000..e421143 Binary files /dev/null and b/projects/icons/tokens_crypton.png differ diff --git a/projects/icons/tokens_dfc.png b/projects/icons/tokens_dfc.png new file mode 100644 index 0000000..caffdef Binary files /dev/null and b/projects/icons/tokens_dfc.png differ diff --git a/projects/icons/tokens_dick.png b/projects/icons/tokens_dick.png new file mode 100644 index 0000000..99c73b0 Binary files /dev/null and b/projects/icons/tokens_dick.png differ diff --git a/projects/icons/tokens_duck.png b/projects/icons/tokens_duck.png new file mode 100644 index 0000000..cfeddeb Binary files /dev/null and b/projects/icons/tokens_duck.png differ diff --git a/projects/icons/tokens_durev.png b/projects/icons/tokens_durev.png new file mode 100644 index 0000000..774e22f Binary files /dev/null and b/projects/icons/tokens_durev.png differ diff --git a/projects/icons/tokens_dyor.png b/projects/icons/tokens_dyor.png new file mode 100644 index 0000000..486e038 Binary files /dev/null and b/projects/icons/tokens_dyor.png differ diff --git a/projects/icons/tokens_fish.png b/projects/icons/tokens_fish.png new file mode 100644 index 0000000..67ebaa6 Binary files /dev/null and b/projects/icons/tokens_fish.png differ diff --git a/projects/icons/tokens_fnz.svg b/projects/icons/tokens_fnz.svg new file mode 100644 index 0000000..c64b15d --- /dev/null +++ b/projects/icons/tokens_fnz.svg @@ -0,0 +1,10 @@ + diff --git a/projects/icons/tokens_gemston.png b/projects/icons/tokens_gemston.png new file mode 100644 index 0000000..d0d86a7 Binary files /dev/null and b/projects/icons/tokens_gemston.png differ diff --git a/projects/icons/tokens_glint.png b/projects/icons/tokens_glint.png new file mode 100644 index 0000000..283492c Binary files /dev/null and b/projects/icons/tokens_glint.png differ diff --git a/projects/icons/tokens_gram.svg b/projects/icons/tokens_gram.svg new file mode 100644 index 0000000..c0548ff --- /dev/null +++ b/projects/icons/tokens_gram.svg @@ -0,0 +1,4 @@ + diff --git a/projects/icons/tokens_hif.png b/projects/icons/tokens_hif.png new file mode 100644 index 0000000..4770371 Binary files /dev/null and b/projects/icons/tokens_hif.png differ diff --git a/projects/icons/tokens_hydra.png b/projects/icons/tokens_hydra.png new file mode 100644 index 0000000..d18b8e7 Binary files /dev/null and b/projects/icons/tokens_hydra.png differ diff --git a/projects/icons/tokens_ins.png b/projects/icons/tokens_ins.png new file mode 100644 index 0000000..fea351f Binary files /dev/null and b/projects/icons/tokens_ins.png differ diff --git a/projects/icons/tokens_jetton.png b/projects/icons/tokens_jetton.png new file mode 100644 index 0000000..3927bb4 Binary files /dev/null and b/projects/icons/tokens_jetton.png differ diff --git a/projects/icons/tokens_jnano.svg b/projects/icons/tokens_jnano.svg new file mode 100644 index 0000000..0232ef0 --- /dev/null +++ b/projects/icons/tokens_jnano.svg @@ -0,0 +1,34 @@ + diff --git a/projects/icons/tokens_jvt.png b/projects/icons/tokens_jvt.png new file mode 100644 index 0000000..316c628 Binary files /dev/null and b/projects/icons/tokens_jvt.png differ diff --git a/projects/icons/tokens_kakaxa.png b/projects/icons/tokens_kakaxa.png new file mode 100644 index 0000000..e12a6a1 Binary files /dev/null and b/projects/icons/tokens_kakaxa.png differ diff --git a/projects/icons/tokens_kingy.png b/projects/icons/tokens_kingy.png new file mode 100644 index 0000000..3e117d1 Binary files /dev/null and b/projects/icons/tokens_kingy.png differ diff --git a/projects/icons/tokens_kong.png b/projects/icons/tokens_kong.png new file mode 100644 index 0000000..fabe951 Binary files /dev/null and b/projects/icons/tokens_kong.png differ diff --git a/projects/icons/tokens_lave.png b/projects/icons/tokens_lave.png new file mode 100644 index 0000000..25367f0 Binary files /dev/null and b/projects/icons/tokens_lave.png differ diff --git a/projects/icons/tokens_llama.png b/projects/icons/tokens_llama.png new file mode 100644 index 0000000..473d06b Binary files /dev/null and b/projects/icons/tokens_llama.png differ diff --git a/projects/icons/tokens_magic crystal.png b/projects/icons/tokens_magic crystal.png new file mode 100644 index 0000000..d122a39 Binary files /dev/null and b/projects/icons/tokens_magic crystal.png differ diff --git a/projects/icons/tokens_mars.png b/projects/icons/tokens_mars.png new file mode 100644 index 0000000..0a5c305 Binary files /dev/null and b/projects/icons/tokens_mars.png differ diff --git a/projects/icons/tokens_meh.png b/projects/icons/tokens_meh.png new file mode 100644 index 0000000..23d9970 Binary files /dev/null and b/projects/icons/tokens_meh.png differ diff --git a/projects/icons/tokens_mem.png b/projects/icons/tokens_mem.png new file mode 100644 index 0000000..cefa486 Binary files /dev/null and b/projects/icons/tokens_mem.png differ diff --git a/projects/icons/tokens_mittens.png b/projects/icons/tokens_mittens.png new file mode 100644 index 0000000..91ca1a9 Binary files /dev/null and b/projects/icons/tokens_mittens.png differ diff --git a/projects/icons/tokens_morfey.png b/projects/icons/tokens_morfey.png new file mode 100644 index 0000000..4d5bde1 Binary files /dev/null and b/projects/icons/tokens_morfey.png differ diff --git a/projects/icons/tokens_mrdn.png b/projects/icons/tokens_mrdn.png new file mode 100644 index 0000000..e3b83fa Binary files /dev/null and b/projects/icons/tokens_mrdn.png differ diff --git a/projects/icons/tokens_mumba.png b/projects/icons/tokens_mumba.png new file mode 100644 index 0000000..5faa709 Binary files /dev/null and b/projects/icons/tokens_mumba.png differ diff --git a/projects/icons/tokens_open.png b/projects/icons/tokens_open.png new file mode 100644 index 0000000..a2e87dd Binary files /dev/null and b/projects/icons/tokens_open.png differ diff --git a/projects/icons/tokens_opencoin.png b/projects/icons/tokens_opencoin.png new file mode 100644 index 0000000..a22999b Binary files /dev/null and b/projects/icons/tokens_opencoin.png differ diff --git a/projects/icons/tokens_pepe.png b/projects/icons/tokens_pepe.png new file mode 100644 index 0000000..b7bdc68 Binary files /dev/null and b/projects/icons/tokens_pepe.png differ diff --git a/projects/icons/tokens_pet.png b/projects/icons/tokens_pet.png new file mode 100644 index 0000000..23a7d82 Binary files /dev/null and b/projects/icons/tokens_pet.png differ diff --git a/projects/icons/tokens_pizza.png b/projects/icons/tokens_pizza.png new file mode 100644 index 0000000..c94a383 Binary files /dev/null and b/projects/icons/tokens_pizza.png differ diff --git a/projects/icons/tokens_plane.png b/projects/icons/tokens_plane.png new file mode 100644 index 0000000..a3e4f52 Binary files /dev/null and b/projects/icons/tokens_plane.png differ diff --git a/projects/icons/tokens_poe.png b/projects/icons/tokens_poe.png new file mode 100644 index 0000000..1f7fd3d Binary files /dev/null and b/projects/icons/tokens_poe.png differ diff --git a/projects/icons/tokens_punk.png b/projects/icons/tokens_punk.png new file mode 100644 index 0000000..e73c74c Binary files /dev/null and b/projects/icons/tokens_punk.png differ diff --git a/projects/icons/tokens_raff.svg b/projects/icons/tokens_raff.svg new file mode 100644 index 0000000..f91bb13 --- /dev/null +++ b/projects/icons/tokens_raff.svg @@ -0,0 +1,5 @@ + diff --git a/projects/icons/tokens_random.png b/projects/icons/tokens_random.png new file mode 100644 index 0000000..997a3c5 Binary files /dev/null and b/projects/icons/tokens_random.png differ diff --git a/projects/icons/tokens_reca.png b/projects/icons/tokens_reca.png new file mode 100644 index 0000000..eef99f0 Binary files /dev/null and b/projects/icons/tokens_reca.png differ diff --git a/projects/icons/tokens_redo.png b/projects/icons/tokens_redo.png new file mode 100644 index 0000000..7e10c54 Binary files /dev/null and b/projects/icons/tokens_redo.png differ diff --git a/projects/icons/tokens_regi.png b/projects/icons/tokens_regi.png new file mode 100644 index 0000000..6d65a7e Binary files /dev/null and b/projects/icons/tokens_regi.png differ diff --git a/projects/icons/tokens_scale.png b/projects/icons/tokens_scale.png new file mode 100644 index 0000000..1db6a6f Binary files /dev/null and b/projects/icons/tokens_scale.png differ diff --git a/projects/icons/tokens_ship.png b/projects/icons/tokens_ship.png new file mode 100644 index 0000000..b9320bf Binary files /dev/null and b/projects/icons/tokens_ship.png differ diff --git a/projects/icons/tokens_shit.png b/projects/icons/tokens_shit.png new file mode 100644 index 0000000..3d89bc8 Binary files /dev/null and b/projects/icons/tokens_shit.png differ diff --git a/projects/icons/tokens_sox.png b/projects/icons/tokens_sox.png new file mode 100644 index 0000000..e58b14c Binary files /dev/null and b/projects/icons/tokens_sox.png differ diff --git a/projects/icons/tokens_sqd.png b/projects/icons/tokens_sqd.png new file mode 100644 index 0000000..453d0ca Binary files /dev/null and b/projects/icons/tokens_sqd.png differ diff --git a/projects/icons/tokens_ston.png b/projects/icons/tokens_ston.png new file mode 100644 index 0000000..7b98cf6 Binary files /dev/null and b/projects/icons/tokens_ston.png differ diff --git a/projects/icons/tokens_tgram.png b/projects/icons/tokens_tgram.png new file mode 100644 index 0000000..8566122 Binary files /dev/null and b/projects/icons/tokens_tgram.png differ diff --git a/projects/icons/tokens_tiger.png b/projects/icons/tokens_tiger.png new file mode 100644 index 0000000..7fb090c Binary files /dev/null and b/projects/icons/tokens_tiger.png differ diff --git a/projects/icons/tokens_tinu.png b/projects/icons/tokens_tinu.png new file mode 100644 index 0000000..e5097b1 Binary files /dev/null and b/projects/icons/tokens_tinu.png differ diff --git a/projects/icons/tokens_ton stars.png b/projects/icons/tokens_ton stars.png new file mode 100644 index 0000000..7472c63 Binary files /dev/null and b/projects/icons/tokens_ton stars.png differ diff --git a/projects/icons/tokens_tonald.png b/projects/icons/tokens_tonald.png new file mode 100644 index 0000000..8404b8e Binary files /dev/null and b/projects/icons/tokens_tonald.png differ diff --git a/projects/icons/tokens_tong.png b/projects/icons/tokens_tong.png new file mode 100644 index 0000000..9f6db51 Binary files /dev/null and b/projects/icons/tokens_tong.png differ diff --git a/projects/icons/tokens_tonk.png b/projects/icons/tokens_tonk.png new file mode 100644 index 0000000..d07cc90 Binary files /dev/null and b/projects/icons/tokens_tonk.png differ diff --git a/projects/icons/tokens_tonnel.png b/projects/icons/tokens_tonnel.png new file mode 100644 index 0000000..3c1a3a4 Binary files /dev/null and b/projects/icons/tokens_tonnel.png differ diff --git a/projects/icons/tokens_up.svg b/projects/icons/tokens_up.svg new file mode 100644 index 0000000..304c686 --- /dev/null +++ b/projects/icons/tokens_up.svg @@ -0,0 +1,11 @@ + diff --git a/projects/icons/tokens_virus.png b/projects/icons/tokens_virus.png new file mode 100644 index 0000000..46dd087 Binary files /dev/null and b/projects/icons/tokens_virus.png differ diff --git a/projects/icons/tokens_wall.png b/projects/icons/tokens_wall.png new file mode 100644 index 0000000..6b9054d Binary files /dev/null and b/projects/icons/tokens_wall.png differ diff --git a/projects/icons/tokens_web3.png b/projects/icons/tokens_web3.png new file mode 100644 index 0000000..fafc1eb Binary files /dev/null and b/projects/icons/tokens_web3.png differ diff --git a/projects/icons/tokens_wif.png b/projects/icons/tokens_wif.png new file mode 100644 index 0000000..8d9e515 Binary files /dev/null and b/projects/icons/tokens_wif.png differ diff --git a/projects/icons/tokens_wnot.png b/projects/icons/tokens_wnot.png new file mode 100644 index 0000000..594bca1 Binary files /dev/null and b/projects/icons/tokens_wnot.png differ diff --git a/projects/icons/tokens_won.png b/projects/icons/tokens_won.png new file mode 100644 index 0000000..3d676d9 Binary files /dev/null and b/projects/icons/tokens_won.png differ diff --git a/requirements.txt b/requirements.txt index de7a5a0..ee11420 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ loguru==0.7.2 psycopg2==2.9.5 gitpython requests -tonsdk \ No newline at end of file +tonsdk +pillow \ No newline at end of file diff --git a/seasons/s3_5.py b/seasons/s3_5.py index f008f79..7828a1a 100644 --- a/seasons/s3_5.py +++ b/seasons/s3_5.py @@ -173,4 +173,4 @@ ], score_model=NFTLeaderboardModelV1() -) \ No newline at end of file +) diff --git a/seasons/s4.py b/seasons/s4.py index bb5f641..adc32a0 100644 --- a/seasons/s4.py +++ b/seasons/s4.py @@ -294,4 +294,4 @@ }, # 2024-06-12 14:59:57.000 +0400 block_before_start_ref='-1,8000000000000000,38319277,6D29F1A684BDA0C354E309C6BD47DD64FF5A9406D714BEBD4F7C4684D77CF339,5AB65BBD48348225CC03725564DB27EEF0C6E4FA0B275DB21B80323BBE0940E1' -) \ No newline at end of file +) diff --git a/validate.py b/validate.py new file mode 100644 index 0000000..74e5ea7 --- /dev/null +++ b/validate.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +import glob +from PIL import Image + +import importlib.util +import sys + +from models.icons import get_icon_name +from models.season_config import SeasonConfig + +if __name__ == '__main__': + for file in glob.glob("seasons/s*py"): + # some weird Python introspection hacks to ge all seasons and extract all projects + season_name = file.split("/")[1].split(".")[0] + import_stmt = f"seasons.{season_name}" + print(f"Importing {import_stmt}") + m = __import__(import_stmt, globals(), locals(), ['SeasonConfig']) + # print(m.__dict__) + for name, season_config in dict([(name, cls) for name, cls in m.__dict__.items() if isinstance(cls, SeasonConfig)]).items(): + print(f"Checking {name} from {season_name}") + for project in season_config.projects: + image = get_icon_name(season_config, project) + if image.endswith(".svg"): + continue + assert image.endswith(".png"), "Only png and svg formats are supported" + image_obj = Image.open("projects/icons/" + image) + assert image_obj.size == (100, 100), f"Image {image} for project {project.name} " \ + f"has wrong dimensions: %dx%d" % image_obj.size +