mirror of
https://github.com/gogcom/galaxy-integrations-python-api.git
synced 2026-01-01 03:18:25 -05:00
Compare commits
6 Commits
0.31
...
deployed_0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a115557b3 | ||
|
|
14c2d7d9e8 | ||
|
|
4a7a759cea | ||
|
|
da8da24b01 | ||
|
|
ccbb13e685 | ||
|
|
a3ca815975 |
56
README.md
56
README.md
@@ -1,24 +1,52 @@
|
||||
# Galaxy python plugin API
|
||||
# GOG Galaxy - Community Integration - Python API
|
||||
|
||||
## Usage
|
||||
This document is still work in progress.
|
||||
|
||||
Implement plugin:
|
||||
## Basic Usage
|
||||
|
||||
Basic implementation:
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from galaxy.api.plugin import Plugin
|
||||
import sys
|
||||
from galaxy.api.plugin import Plugin, create_and_run_plugin
|
||||
from galaxy.api.consts import Platform
|
||||
|
||||
class PluginExample(Plugin):
|
||||
def __init__(self, reader, writer, token):
|
||||
super().__init__(
|
||||
Platform.Generic, # Choose platform from available list
|
||||
"0.1", # Version
|
||||
reader,
|
||||
writer,
|
||||
token
|
||||
)
|
||||
|
||||
# implement methods
|
||||
async def authenticate(self, stored_credentials=None):
|
||||
pass
|
||||
|
||||
def main():
|
||||
create_and_run_plugin(PluginExample, sys.argv)
|
||||
|
||||
# run plugin event loop
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(MockPlugin().run())
|
||||
main()
|
||||
```
|
||||
|
||||
Use [pyinstaller](https://www.pyinstaller.org/) to create plugin executbale.
|
||||
Plugin should be deployed with manifest:
|
||||
```json
|
||||
{
|
||||
"name": "Example plugin",
|
||||
"platform": "generic",
|
||||
"guid": "UNIQUE-GUID",
|
||||
"version": "0.1",
|
||||
"description": "Example plugin",
|
||||
"author": "Name",
|
||||
"email": "author@email.com",
|
||||
"url": "https://github.com/user/galaxy-plugin-example",
|
||||
"script": "plugin.py"
|
||||
}
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
@@ -31,15 +59,5 @@ Run tests:
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
### 0.21
|
||||
* Add `Epic` platform.
|
||||
### 0.16
|
||||
* Do not log sensitive data.
|
||||
* Return `LocalGameState` as int (possible combination of flags).
|
||||
### 0.15
|
||||
* `shutdown()` is called on socket disconnection.
|
||||
### 0.14
|
||||
* Added required version parameter to Plugin constructor.
|
||||
## Methods Documentation
|
||||
TODO
|
||||
|
||||
@@ -4,7 +4,7 @@ stage('Upload to github')
|
||||
deleteDir()
|
||||
checkout scm
|
||||
withPythonEnv('/usr/local/bin/python3.7') {
|
||||
withCredentials([usernamePassword(credentialsId: 'github_friendsofgalaxy', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_TOKEN')]) {
|
||||
withCredentials([string(credentialsId: 'github_goggalaxy', variable: 'GITHUB_TOKEN')]) {
|
||||
sh 'pip install -r jenkins/requirements.txt'
|
||||
def version = sh(returnStdout: true, script: 'python setup.py --version').trim()
|
||||
sh "python jenkins/release.py $version"
|
||||
|
||||
@@ -2,10 +2,10 @@ import os
|
||||
import sys
|
||||
from galaxy.github.exporter import transfer_repo
|
||||
|
||||
GITHUB_USERNAME = "FriendsOfGalaxy"
|
||||
GITHUB_EMAIL = "friendsofgalaxy@gmail.com"
|
||||
GITHUB_USERNAME = "goggalaxy"
|
||||
GITHUB_EMAIL = "galaxy-sdk@gog.com"
|
||||
GITHUB_TOKEN = os.environ["GITHUB_TOKEN"]
|
||||
GITHUB_REPO_NAME = "galaxy-plugin-api"
|
||||
GITHUB_REPO_NAME = "galaxy-integrations-python-api"
|
||||
SOURCE_BRANCH = os.environ["GIT_REFSPEC"]
|
||||
|
||||
GITLAB_USERNAME = "galaxy-client"
|
||||
|
||||
Reference in New Issue
Block a user