mirror of
https://github.com/KevinMidboe/delugeClient.git
synced 2025-10-29 12:00:13 +00:00
Compare commits
6 Commits
ci/build-a
...
snyk-fix-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
286ddec92c | ||
| adf8f3f1ef | |||
| 8f2327c065 | |||
| 9bfa3c4c59 | |||
| 078d422498 | |||
| a6fb543b3f |
34
.drone.yml
34
.drone.yml
@@ -42,12 +42,36 @@ steps:
|
|||||||
- pip3 install delugeClient-kevin -q -q
|
- pip3 install delugeClient-kevin -q -q
|
||||||
- bash publish_version?.sh
|
- bash publish_version?.sh
|
||||||
|
|
||||||
|
- name: PyPi verify
|
||||||
|
image: python:3.10
|
||||||
|
commands:
|
||||||
|
- make dist
|
||||||
|
- pip3 install twine
|
||||||
|
- twine check dist/*
|
||||||
|
|
||||||
|
- name: PyPi test publish
|
||||||
|
image: python:3.10
|
||||||
|
environment:
|
||||||
|
TWINE_USERNAME:
|
||||||
|
from_secret: TWINE_USERNAME
|
||||||
|
TWINE_PASSWORD:
|
||||||
|
from_secret: TWINE_TEST_PASSWORD
|
||||||
|
commands:
|
||||||
|
- make dist
|
||||||
|
- pip3 install twine
|
||||||
|
- twine upload --repository-url https://test.pypi.org/legacy/ dist/*
|
||||||
|
|
||||||
- name: PyPi publish
|
- name: PyPi publish
|
||||||
image: python:3.10
|
image: python:3.10
|
||||||
commands:
|
environment:
|
||||||
- make dist
|
TWINE_USERNAME:
|
||||||
- pip3 install twine
|
from_secret: TWINE_USERNAME
|
||||||
- twine upload dist/*
|
TWINE_PASSWORD:
|
||||||
|
from_secret: TWINE_PASSWORD
|
||||||
|
commands:
|
||||||
|
- make dist
|
||||||
|
- pip3 install twine
|
||||||
|
- twine upload dist/*
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- Build and test amd64
|
- Build and test amd64
|
||||||
@@ -61,6 +85,6 @@ trigger:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 08793426ddd2274e2de166144dc15cd63fe6a2c0fd47382d28f20ececee84898
|
hmac: 60604a21f35e11d078d5d381bbea8e25b903175c018ba9e6f4a4379285e89883
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|||||||
49
README.md
49
README.md
@@ -37,31 +37,38 @@ pip3 install delugeClient-kevin
|
|||||||
```
|
```
|
||||||
|
|
||||||
## <a name="usage"></a> Usage
|
## <a name="usage"></a> Usage
|
||||||
View delugeClient cli options with `delugeClient --help`:
|
View delugeClient cli options with `delugeclient --help`:
|
||||||
|
|
||||||
```
|
```
|
||||||
Usage: python -m delugeclient [OPTIONS] COMMAND [ARGS]...
|
Usage: python -m delugeclient [OPTIONS] COMMAND [ARGS]...
|
||||||
|
|
||||||
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
╭─ Options ───────────────────────────────────────────────────────────────╮
|
||||||
│ --debug Set log level to debug │
|
│ --debug Set log level to debug │
|
||||||
│ --info Set log level to info │
|
│ --info Set log level to info │
|
||||||
│ --warning Set log level to warning │
|
│ --warning Set log level to warning │
|
||||||
│ --error Set log level to error │
|
│ --error Set log level to error │
|
||||||
│ --install-completion Install completion for the current shell. │
|
│ --install-completion Install completion for the current shell. │
|
||||||
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
|
│ --show-completion Show completion for the current shell │
|
||||||
│ --help Show this message and exit. │
|
│ --help Show this message and exit. │
|
||||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
╰─────────────────────────────────────────────────────────────────────────╯
|
||||||
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
╭─ Commands ──────────────────────────────────────────────────────────────╮
|
||||||
│ add Add magnet torrent │
|
│ add Add magnet torrent │
|
||||||
│ disk Get free disk space │
|
│ disk Get free disk space │
|
||||||
│ get Get torrent by id or hash │
|
│ get Get torrent by id or hash │
|
||||||
│ ls List all torrents │
|
│ ls List all torrents │
|
||||||
│ remove Remove torrent by id or hash │
|
│ remove Remove torrent by id or hash │
|
||||||
│ rm Remove torrent by name │
|
│ rm Remove torrent by name │
|
||||||
│ search Search for string segment in torrent name │
|
│ search Search for string segment in torrent name │
|
||||||
│ toggle Toggle torrent download state │
|
│ toggle Toggle torrent download state │
|
||||||
│ version Print package version │
|
│ version Print package version │
|
||||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
╰─────────────────────────────────────────────────────────────────────────╯
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running from source
|
||||||
|
Run from source for fun or during development using module flag:
|
||||||
|
|
||||||
|
```
|
||||||
|
python3 -m delugeClient --help
|
||||||
```
|
```
|
||||||
|
|
||||||
## <a name="setup_virtualenv"></a> Setup Virtual Environment
|
## <a name="setup_virtualenv"></a> Setup Virtual Environment
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
from sys import path
|
from sys import path
|
||||||
from os.path import dirname, join
|
from os.path import dirname, join, abspath
|
||||||
|
|
||||||
path.append(dirname(__file__))
|
SCRIPT_DIR = dirname(abspath(__file__))
|
||||||
|
path.append(dirname(SCRIPT_DIR))
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from utils import BASE_DIR
|
from delugeClient.utils import BASE_DIR
|
||||||
|
from delugeClient.deluge import Deluge
|
||||||
|
|
||||||
def addHandler(handler):
|
def addHandler(handler):
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python3.10
|
#!/usr/bin/env python3.10
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import signal
|
import signal
|
||||||
@@ -8,10 +7,10 @@ import logging
|
|||||||
import typer
|
import typer
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
from deluge import Deluge
|
from delugeClient.deluge import Deluge
|
||||||
from utils import ColorizeFilter, BASE_DIR, validHash, convertFilesize
|
from delugeClient.utils import ColorizeFilter, BASE_DIR, validHash, convertFilesize
|
||||||
from __version__ import __version__
|
from delugeClient.__version__ import __version__
|
||||||
from __init__ import addHandler
|
from delugeClient.__init__ import addHandler
|
||||||
|
|
||||||
ch = logging.StreamHandler()
|
ch = logging.StreamHandler()
|
||||||
ch.addFilter(ColorizeFilter())
|
ch.addFilter(ColorizeFilter())
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
__version__ = '0.3.2'
|
__version__ = '0.3.5'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(__version__)
|
print(__version__)
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import logging.config
|
|||||||
|
|
||||||
from deluge_client import DelugeRPCClient, FailedToReconnectException
|
from deluge_client import DelugeRPCClient, FailedToReconnectException
|
||||||
from sshtunnel import SSHTunnelForwarder, BaseSSHTunnelForwarderError
|
from sshtunnel import SSHTunnelForwarder, BaseSSHTunnelForwarderError
|
||||||
from utils import getConfig, BASE_DIR
|
|
||||||
|
|
||||||
from torrent import Torrent
|
from delugeClient.utils import getConfig, BASE_DIR
|
||||||
|
from delugeClient.torrent import Torrent
|
||||||
|
|
||||||
logger = logging.getLogger('deluge_cli')
|
logger = logging.getLogger('deluge_cli')
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
from distutils.util import strtobool
|
from distutils.util import strtobool
|
||||||
|
|
||||||
from utils import convert
|
from delugeClient.utils import convert
|
||||||
|
|
||||||
logger = logging.getLogger('deluge_cli')
|
logger = logging.getLogger('deluge_cli')
|
||||||
|
|
||||||
@@ -44,5 +44,5 @@ class Torrent(object):
|
|||||||
return json.dumps(torrentDict)
|
return json.dumps(torrentDict)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{} {} Progress: {}% ETA: {} State: {} Paused: {}".format(
|
return "{} Progress: {}% ETA: {} State: {} Paused: {}".format(
|
||||||
self.key, self.name[:59].ljust(60), self.progress.rjust(5), self.eta.rjust(11), self.state.ljust(12), self.paused)
|
self.name[:59].ljust(60), self.progress.rjust(5), self.eta.rjust(11), self.state.ljust(12), self.paused)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
colored==1.4.4
|
colored==1.4.4
|
||||||
deluge-client==1.9.0
|
deluge-client==1.9.0
|
||||||
requests==2.28.1
|
requests==2.32.4
|
||||||
sshtunnel==0.4.0
|
sshtunnel==0.4.0
|
||||||
typer==0.7.0
|
typer==0.7.0
|
||||||
|
|||||||
Reference in New Issue
Block a user