Skip to content

Commit

Permalink
Reformat code with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jun 12, 2024
1 parent 81c0bac commit 5902f1e
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ https://www.iso.org/standard/77899.html

!!! attention
The `iscc-sdk` library and the accompanying documentation is under development. API changes and
other backward incompatible changes are to be expected until the upcoming v1.5 stable release.
other backward incompatible changes are to be expected until the upcoming v1.0 stable release.

## Maintainers

Expand Down
1 change: 1 addition & 0 deletions devtools/build_docs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Copy README.md to documentation site index.md."""

from os.path import abspath, dirname, join


Expand Down
1 change: 1 addition & 0 deletions devtools/lf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convert line endings to LF"""

import pathlib

HERE = pathlib.Path(__file__).parent.parent.absolute()
Expand Down
1 change: 1 addition & 0 deletions docs/images/build_docs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Copy README.md to documentation index.md"""

from os.path import abspath, dirname, join
import shutil

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ https://www.iso.org/standard/77899.html

!!! attention
The `iscc-sdk` library and the accompanying documentation is under development. API changes and
other backward incompatible changes are to be expected until the upcoming v1.5 stable release.
other backward incompatible changes are to be expected until the upcoming v1.0 stable release.

## Maintainers

Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ISCC - Software Development Kit."""

import os
from platformdirs import PlatformDirs

Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/audio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Audio handling module*."""

import shutil
import tempfile
from os.path import join, basename
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/epub.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*EPUB handling module*."""

import io
import shutil
import tempfile
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Image handling module*."""

import pillow_avif
import base64
import io
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/install.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Installer script for binary dependencies"""

import sys
from loguru import logger as log
import iscc_sdk as idk
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/ipfs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""IPFS wrapper"""

import sys
from os.path import basename
import iscc_sdk as idk
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*SDK main top-level functions*."""

from concurrent.futures import ThreadPoolExecutor
from os.path import basename
from PIL import Image
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/mediatype.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Detect and map RFC6838 mediatypes to ISCC processing modes*."""

from os.path import basename
from loguru import logger as log
from typing import List, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Metadata handling functions*"""

from typing import Optional

try:
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/monkeys.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Monkey Patches"""

import ebookmeta
from ebookmeta import Epub2, _get_ebook

Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""

from typing import Optional

try:
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/pdf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*PDF handling module*."""

import shutil
import tempfile
from PIL import Image, ImageEnhance
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Text handling functions*."""

import json
import sys
from os.path import basename, splitext
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/thumbnail.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Generate thumbnails for media assets*"""

from typing import Optional
from PIL import Image
import iscc_sdk as idk
Expand Down
3 changes: 1 addition & 2 deletions iscc_sdk/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Manage SDK binary media file handling tools*."""

import os
import shutil
import subprocess
Expand Down Expand Up @@ -131,7 +132,6 @@ def extract(archive): # pragma: no cover
with tarfile.open(archive, "r:gz") as tar_file:

def is_within_directory(directory, target):

abs_directory = os.path.abspath(directory)
abs_target = os.path.abspath(target)

Expand All @@ -140,7 +140,6 @@ def is_within_directory(directory, target):
return prefix == abs_directory

def safe_extract(tar, path=".", members=None, *, numeric_owner=False):

for member in tar.getmembers():
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):
Expand Down
1 change: 1 addition & 0 deletions iscc_sdk/video.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""*Video handling module*"""

import os
from typing import Tuple, List, Optional
from loguru import logger as log
Expand Down

0 comments on commit 5902f1e

Please sign in to comment.