readme & license

This commit is contained in:
2019-09-06 01:33:11 +03:00
parent 9f19519b75
commit df8fa43344
27 changed files with 324 additions and 12 deletions

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from enum import Enum
from json import JSONEncoder
from typing import Any

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from aiohttp.web import Application
from .views.bis import BiSView

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import json
from aiohttp.web import Response

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from aiohttp.web import Response, View
from typing import Iterable, Optional
@ -33,7 +41,7 @@ class BiSView(View):
except Exception:
data = dict(await self.request.post())
required = ['action', 'job', 'nick']
required = ['action', 'is_tome', 'job', 'nick', 'piece']
if any(param not in data for param in required):
return wrap_invalid_param(required, data)
player_id = PlayerId(Job[data['job']], data['nick'])
@ -42,20 +50,11 @@ class BiSView(View):
if action not in ('add', 'remove'):
return wrap_invalid_param(['action'], data)
piece: Optional[Piece] = None
try:
piece = Piece.get(data) # type: ignore
if action == 'add':
if 'is_tome' not in data or 'piece' not in data:
return wrap_invalid_param(['is_tome', 'piece'], data)
piece = Piece.get(data) # type: ignore
self.request.app['party'].set_item_bis(player_id, piece)
elif action == 'remove':
if 'is_tome' not in data or 'piece' not in data:
return wrap_invalid_param(['is_tome', 'piece'], data)
piece = Piece.get(data) # type: ignore
self.request.app['party'].remove_item_bis(player_id, piece)
except Exception as e:

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from aiohttp.web import Response, View
from typing import Iterable
@ -45,7 +53,6 @@ class LootView(View):
piece = Piece.get(data)
if action == 'add':
self.request.app['party'].set_item(player_id, piece)
elif action == 'remove':
self.request.app['party'].remove_item(player_id, piece)

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from aiohttp.web import Response, View
from typing import Iterable

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import logging
from aiohttp import web

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from service.core.config import Configuration
from .core import Application

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import logging
from service.api.web import run_server, setup_service

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import os
import requests

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import configparser
import os

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from __future__ import annotations
import datetime

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from typing import Any, Mapping

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from typing import Iterable, List, Tuple, Union
from service.models.player import Player, PlayerIdWithCounters

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from __future__ import annotations
from threading import Lock

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from typing import List, Optional, Union
from service.models.bis import BiS

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
# because sqlite3 does not support context management
import sqlite3

View File

@ -1 +1,9 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
__version__ = '0.1.0'

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
import itertools
from dataclasses import dataclass

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from __future__ import annotations
from enum import Enum, auto

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from dataclasses import dataclass
from typing import Union

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from __future__ import annotations
from dataclasses import dataclass

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from dataclasses import dataclass
from typing import List, Optional, Union

View File

@ -1,3 +1,11 @@
#
# Copyright (c) 2019 Evgeniy Alekseev.
#
# This file is part of ffxivbis
# (see https://github.com/arcan1s/ffxivbis).
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from enum import Enum, auto
from typing import List