mirror of
https://github.com/subutux/rmapy.git
synced 2025-12-09 15:05:35 +00:00
Compare commits
7 Commits
bsdz-patch
...
v0.2.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5f0367dbb | ||
|
|
bc36d7b7c6 | ||
|
|
15d8090e79 | ||
|
|
8bb29e3bd7 | ||
|
|
29d113f3af | ||
|
|
433eb8e722 | ||
|
|
7ceac42fdb |
31
.github/workflows/python-publish.yml
vendored
Normal file
31
.github/workflows/python-publish.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# This workflows will upload a Python Package using Twine when a release is created
|
||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine
|
||||
- name: Build and publish
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
||||
@@ -14,4 +14,3 @@ This is an (unofficial) Remarkable Cloud API Client written in Python.
|
||||
* ❎ cli interface
|
||||
* ❎ export pdf with annotations
|
||||
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ and use the code you see on the webpage
|
||||
# stored in the users directory in the file ~/.rmapi, the same as with the
|
||||
# go rmapi client.
|
||||
rmapy.register_device("fkgzzklrs")
|
||||
# It's always a good idea to refresh the user token every time you start
|
||||
# It's always a good idea to renew the user token every time you start
|
||||
# a new session.
|
||||
rmapy.refresh_token()
|
||||
rmapy.renew_token()
|
||||
# Should return True
|
||||
rmapy.is_auth()
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ class Collection(object):
|
||||
items: A list containing the items.
|
||||
"""
|
||||
|
||||
items: List[DocumentOrFolder] = []
|
||||
|
||||
def __init__(self, *items: List[DocumentOrFolder]):
|
||||
self.items: List[DocumentOrFolder] = []
|
||||
|
||||
for i in items:
|
||||
self.items.append(i)
|
||||
|
||||
|
||||
@@ -5,9 +5,11 @@ import shutil
|
||||
from uuid import uuid4
|
||||
import json
|
||||
from typing import TypeVar, List, Tuple
|
||||
from logging import getLogger
|
||||
from requests import Response
|
||||
from .meta import Meta
|
||||
|
||||
log = getLogger("rmapy")
|
||||
BytesOrString = TypeVar("BytesOrString", BytesIO, str)
|
||||
|
||||
|
||||
@@ -311,7 +313,6 @@ class ZipDocument(object):
|
||||
pass
|
||||
|
||||
# Get the RM pages
|
||||
|
||||
pages = [x for x in zf.namelist()
|
||||
if x.startswith(f"{self.ID}/") and x.endswith('.rm')]
|
||||
for p in pages:
|
||||
@@ -322,11 +323,16 @@ class ZipDocument(object):
|
||||
page.seek(0)
|
||||
with zf.open(p.replace(".rm", "-metadata.json"), 'r') as md:
|
||||
metadata = json.load(md)
|
||||
|
||||
thumbnail_name = p.replace(".rm", ".jpg")
|
||||
thumbnail_name = thumbnail_name.replace("/", ".thumbnails/")
|
||||
with zf.open(thumbnail_name, 'r') as tn:
|
||||
thumbnail = BytesIO(tn.read())
|
||||
thumbnail.seek(0)
|
||||
try:
|
||||
with zf.open(thumbnail_name, 'r') as tn:
|
||||
thumbnail = BytesIO(tn.read())
|
||||
thumbnail.seek(0)
|
||||
except KeyError:
|
||||
log.debug(f"missing thumbnail: {thumbnail_name}")
|
||||
thumbnail = None
|
||||
|
||||
self.rm.append(RmPage(page, metadata, page_number, thumbnail,
|
||||
self.ID))
|
||||
|
||||
2
setup.py
2
setup.py
@@ -37,7 +37,7 @@ setup(
|
||||
# For a discussion on single-sourcing the version across setup.py and the
|
||||
# project code, see
|
||||
# https://packaging.python.org/en/latest/single_source_version.html
|
||||
version='0.2.2', # Required
|
||||
version='0.2.3', # Required
|
||||
|
||||
# This is a one-line description or tagline of what your project does. This
|
||||
# corresponds to the "Summary" metadata field:
|
||||
|
||||
Reference in New Issue
Block a user