24 Commits

Author SHA1 Message Date
e81f5f618e Sign drone config file
View docs for more info on signing: https://docs.drone.io/signature/
2022-11-26 13:24:23 +01:00
4b5500ec3b Try install built wheel with wildcard 2022-11-26 13:10:38 +01:00
29c9feeaa1 Bumped package version to 0.3.2 2022-11-26 13:05:53 +01:00
c36bacc264 Exclude publish step when PR towards master 2022-11-26 13:03:11 +01:00
48e5b3bf3e Remove test pypi publish ci step 2022-11-26 12:58:18 +01:00
8853ae85d8 Updated readme and license in setup.py 2022-11-26 12:55:43 +01:00
07c6e6fbe1 Only run public package when interacting with master 2022-11-26 12:53:44 +01:00
4d861e1739 Merged with upstream 2022-11-25 01:23:05 +01:00
5acf8e8848 Clearer output text for publish version 2022-11-25 01:21:59 +01:00
103696e01a Clearer output text for publish version 2022-11-25 01:03:59 +01:00
b1018d7f9d Merge branch 'ci/build-and-pypi-publish' of github.com:kevinmidboe/delugeClient into ci/build-and-pypi-publish 2022-11-25 00:56:02 +01:00
7d4f4d0e9b If source is newer than pypi, exit 0 and continue pipeline 2022-11-25 00:38:35 +01:00
2f716e65a3 If source is newer than pypi, exit 0 and continue pipeline 2022-11-25 00:33:22 +01:00
fa59acfd03 Twince check command before upload 2022-11-25 00:01:40 +01:00
120d300b07 Install python dependencies before publish 2022-11-24 23:49:18 +01:00
0faa42a048 Publish depends on build 2022-11-24 23:13:29 +01:00
e2db73bf2a fixed typo in pacakge name 2022-11-24 23:05:28 +01:00
0841fdc03d sync pipenv after install 2022-11-24 22:57:03 +01:00
76c99568a8 try install requirements first 2022-11-24 22:50:04 +01:00
09e496a907 test explicitly defining wheel version 2022-11-24 22:46:54 +01:00
3989523632 add missing pipenv command 2022-11-24 22:43:18 +01:00
30c3e117da test step indentation fking with lint 2022-11-24 22:40:30 +01:00
3fa8c4b18f Add build for amd64 & arm64 arch + start of publish steps 2022-11-24 22:30:03 +01:00
11e9677d1a Split wheel and tarball dist into separate make cmds 2022-11-24 22:29:50 +01:00
8 changed files with 41 additions and 73 deletions

View File

@@ -42,36 +42,12 @@ steps:
- pip3 install delugeClient-kevin -q -q
- 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
image: python:3.10
environment:
TWINE_USERNAME:
from_secret: TWINE_USERNAME
TWINE_PASSWORD:
from_secret: TWINE_PASSWORD
commands:
- make dist
- pip3 install twine
- twine upload dist/*
commands:
- make dist
- pip3 install twine
- twine upload dist/*
depends_on:
- Build and test amd64
@@ -85,6 +61,6 @@ trigger:
---
kind: signature
hmac: 60604a21f35e11d078d5d381bbea8e25b903175c018ba9e6f4a4379285e89883
hmac: 08793426ddd2274e2de166144dc15cd63fe6a2c0fd47382d28f20ececee84898
...

View File

@@ -37,38 +37,31 @@ pip3 install delugeClient-kevin
```
## <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]...
╭─ Options ───────────────────────────────────────────────────────────────╮
│ --debug Set log level to debug │
│ --info Set log level to info │
│ --warning Set log level to warning │
│ --error Set log level to error │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────╮
│ add Add magnet torrent │
│ disk Get free disk space │
│ get Get torrent by id or hash │
│ ls List all torrents │
│ remove Remove torrent by id or hash │
│ rm Remove torrent by name │
│ search Search for string segment in torrent name │
│ toggle Toggle torrent download state │
│ version Print package version │
╰─────────────────────────────────────────────────────────────────────────╯
```
### Running from source
Run from source for fun or during development using module flag:
```
python3 -m delugeClient --help
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────
│ --debug Set log level to debug
│ --info Set log level to info
│ --warning Set log level to warning
│ --error Set log level to error
│ --install-completion Install completion for the current shell.
│ --show-completion Show completion for the current shell, to copy it or customize the installation.
│ --help Show this message and exit.
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────
│ add Add magnet torrent
│ disk Get free disk space
│ get Get torrent by id or hash
│ ls List all torrents
│ remove Remove torrent by id or hash
│ rm Remove torrent by name
│ search Search for string segment in torrent name
│ toggle Toggle torrent download state
│ version Print package version
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
```
## <a name="setup_virtualenv"></a> Setup Virtual Environment

View File

@@ -2,14 +2,12 @@
# -*- encoding: utf-8 -*-
from sys import path
from os.path import dirname, join, abspath
from os.path import dirname, join
SCRIPT_DIR = dirname(abspath(__file__))
path.append(dirname(SCRIPT_DIR))
path.append(dirname(__file__))
import logging
from delugeClient.utils import BASE_DIR
from delugeClient.deluge import Deluge
from utils import BASE_DIR
def addHandler(handler):
handler.setFormatter(formatter)

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python3.10
import os
import sys
import signal
@@ -7,10 +8,10 @@ import logging
import typer
from pprint import pprint
from delugeClient.deluge import Deluge
from delugeClient.utils import ColorizeFilter, BASE_DIR, validHash, convertFilesize
from delugeClient.__version__ import __version__
from delugeClient.__init__ import addHandler
from deluge import Deluge
from utils import ColorizeFilter, BASE_DIR, validHash, convertFilesize
from __version__ import __version__
from __init__ import addHandler
ch = logging.StreamHandler()
ch.addFilter(ColorizeFilter())

View File

@@ -1,4 +1,4 @@
__version__ = '0.3.5'
__version__ = '0.3.2'
if __name__ == '__main__':
print(__version__)

View File

@@ -9,9 +9,9 @@ import logging.config
from deluge_client import DelugeRPCClient, FailedToReconnectException
from sshtunnel import SSHTunnelForwarder, BaseSSHTunnelForwarderError
from utils import getConfig, BASE_DIR
from delugeClient.utils import getConfig, BASE_DIR
from delugeClient.torrent import Torrent
from torrent import Torrent
logger = logging.getLogger('deluge_cli')

View File

@@ -2,7 +2,7 @@ import json
import logging
from distutils.util import strtobool
from delugeClient.utils import convert
from utils import convert
logger = logging.getLogger('deluge_cli')
@@ -44,5 +44,5 @@ class Torrent(object):
return json.dumps(torrentDict)
def __str__(self):
return "{} Progress: {}% ETA: {} State: {} Paused: {}".format(
self.name[:59].ljust(60), self.progress.rjust(5), self.eta.rjust(11), self.state.ljust(12), self.paused)
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)

View File

@@ -1,5 +1,5 @@
colored==1.4.4
deluge-client==1.9.0
requests==2.31.0
requests==2.28.1
sshtunnel==0.4.0
typer==0.7.0