mirror of
https://github.com/gogcom/galaxy-integrations-python-api.git
synced 2026-01-02 03:48:16 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23ef34bed5 | ||
|
|
a4b08f8105 | ||
|
|
4d62b8ccb8 |
@@ -6,7 +6,6 @@ import dataclasses
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
|
|
||||||
from galaxy.api.jsonrpc import Server, NotificationClient
|
from galaxy.api.jsonrpc import Server, NotificationClient
|
||||||
from galaxy.api.consts import Feature
|
from galaxy.api.consts import Feature
|
||||||
@@ -320,29 +319,7 @@ class Plugin():
|
|||||||
async def get_game_times(self):
|
async def get_game_times(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def _prepare_logging(logger_file):
|
|
||||||
root = logging.getLogger()
|
|
||||||
root.setLevel(logging.DEBUG)
|
|
||||||
if logger_file:
|
|
||||||
# ensure destination folder exists
|
|
||||||
os.makedirs(os.path.dirname(os.path.abspath(logger_file)), exist_ok=True)
|
|
||||||
handler = logging.handlers.RotatingFileHandler(
|
|
||||||
logger_file,
|
|
||||||
mode="a",
|
|
||||||
maxBytes=10000000,
|
|
||||||
backupCount=10,
|
|
||||||
encoding="utf-8"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
handler = logging.StreamHandler()
|
|
||||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
||||||
handler.setFormatter(formatter)
|
|
||||||
root.addHandler(handler)
|
|
||||||
|
|
||||||
def create_and_run_plugin(plugin_class, argv):
|
def create_and_run_plugin(plugin_class, argv):
|
||||||
logger_file = argv[3] if len(argv) >= 4 else None
|
|
||||||
_prepare_logging(logger_file)
|
|
||||||
|
|
||||||
if len(argv) < 3:
|
if len(argv) < 3:
|
||||||
logging.critical("Not enough parameters, required: token, port")
|
logging.critical("Not enough parameters, required: token, port")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@@ -8,10 +8,18 @@ class Authentication():
|
|||||||
user_id: str
|
user_id: str
|
||||||
user_name: str
|
user_name: str
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Cookie():
|
||||||
|
name: str
|
||||||
|
value: str
|
||||||
|
domain: Optional[str] = None
|
||||||
|
path: Optional[str] = None
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class NextStep():
|
class NextStep():
|
||||||
next_step: str
|
next_step: str
|
||||||
auth_params: Dict[str, str]
|
auth_params: Dict[str, str]
|
||||||
|
cookies: Optional[List[Cookie]] = None
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class LicenseInfo():
|
class LicenseInfo():
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="galaxy.plugin.api",
|
name="galaxy.plugin.api",
|
||||||
version="0.19",
|
version="0.20",
|
||||||
description="Galaxy python plugin API",
|
description="Galaxy python plugin API",
|
||||||
author='Galaxy team',
|
author='Galaxy team',
|
||||||
author_email='galaxy@gog.com',
|
author_email='galaxy@gog.com',
|
||||||
|
|||||||
Reference in New Issue
Block a user