Skip to content

Commit

Permalink
new isort and new black version requires reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Feb 7, 2024
1 parent 98f4aa7 commit 24a2a89
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion voctopublish/api_client/bluesky_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from re import finditer

import requests

from tools.announcements import EmptyAnnouncementMessage, make_message

LOG = logging.getLogger("Bluesky")
Expand Down
8 changes: 5 additions & 3 deletions voctopublish/api_client/googlechat_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ def send_chat_message(ticket, config):
"widgets": [
{
"textParagraph": {
"text": ticket.abstract
if ticket.abstract
else "",
"text": (
ticket.abstract
if ticket.abstract
else ""
),
},
},
*key_value,
Expand Down
1 change: 0 additions & 1 deletion voctopublish/api_client/mastodon_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from pathlib import Path

from mastodon import Mastodon

from tools.announcements import EmptyAnnouncementMessage, make_message


Expand Down
3 changes: 1 addition & 2 deletions voctopublish/api_client/twitter_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

import logging

from twitter import OAuth, Twitter

from tools.announcements import EmptyAnnouncementMessage, make_message
from twitter import OAuth, Twitter


def send_tweet(ticket, config):
Expand Down
1 change: 0 additions & 1 deletion voctopublish/api_client/voctoweb_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import paramiko
import requests

from model.ticket_module import Ticket
from tools.thumbnails import ThumbnailGenerator

Expand Down
1 change: 0 additions & 1 deletion voctopublish/api_client/youtube_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import langcodes
import requests

from model.ticket_module import Ticket
from tools.thumbnails import ThumbnailGenerator

Expand Down
1 change: 1 addition & 0 deletions voctopublish/test/api_client_test/test_c3tt_rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@author: n-te
"""

import unittest

from api_client.c3tt_rpc_client import C3TTClient
Expand Down
7 changes: 4 additions & 3 deletions voctopublish/voctopublish.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
except ImportError:
from rtoml import load as toml_load

from c3tt_rpc_client import C3TTClient

import api_client.bluesky_client as bluesky
import api_client.googlechat_client as googlechat
import api_client.mastodon_client as mastodon
import api_client.twitter_client as twitter
from api_client.rclone_client import RCloneClient
from api_client.voctoweb_client import VoctowebClient
from api_client.youtube_client import YoutubeAPI
from c3tt_rpc_client import C3TTClient
from model.ticket_module import PublishingTicket, RecordingTicket, Ticket
from tools.thumbnails import ThumbnailGenerator

Expand Down Expand Up @@ -600,7 +599,9 @@ def _download_file(self, source, target):
logging.info("Downloading file from: " + source)
if not self.ticket.download_command:
with open(target, "wb") as fh:
with urllib.request.urlopen(urllib.parse.quote(source, safe=":/")) as df:
with urllib.request.urlopen(
urllib.parse.quote(source, safe=":/")
) as df:
# original version tried to write whole file to ram and ran out of memory
# read in 16 kB chunks instead
while True:
Expand Down

0 comments on commit 24a2a89

Please sign in to comment.