Skip to content

Commit 526ecfa

Browse files
committed
cleanup
1 parent 6655032 commit 526ecfa

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

pythonbits/ptpimg.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#!/usr/bin/env python3
1+
# -*- coding: utf-8 -*-
22
# pylint: disable=invalid-name
33
"""
44
Upload image file or image URL to the ptpimg.me image hosting.
55
6-
Borrowed from https://github.com/theirix/ptpimg-uploader/blob/master/ptpimg_uploader.py
6+
Borrowed from
7+
https://github.com/theirix/ptpimg-uploader/blob/master/ptpimg_uploader.py
78
89
"""
910

1011
import contextlib
1112
import mimetypes
1213
import os
1314
from io import BytesIO
14-
from sys import stdout
1515
from textwrap import dedent
1616

1717
import requests
@@ -24,9 +24,9 @@
2424
config.register(
2525
'PtpImg', 'api_key',
2626
dedent("""\
27-
To find your PTPImg API key, login to https://ptpimg.me,
28-
open the page source (i.e. "View->Developer->View source" menu in Chrome),
29-
find the string api_key and copy the hexademical string from the value attribute.
27+
To find your PTPImg API key, login to https://ptpimg.me, open the page
28+
source (i.e. "View->Developer->View source" menu in Chrome), find the
29+
string api_key and copy the hexademical string from the value attribute.
3030
Your API key should look like 43fe0fee-f935-4084-8a38-3e632b0be68c.
3131
3. Enter the API Key below
3232
API Key"""))
@@ -109,7 +109,8 @@ def upload_urls(self, *urls):
109109
resp = requests.get(url, timeout=self.timeout)
110110
if resp.status_code != requests.codes.ok:
111111
raise ValueError(
112-
'Cannot fetch url {} with error {}'.format(url, resp.status_code))
112+
'Cannot fetch url {} with error {}'.format(
113+
url, resp.status_code))
113114

114115
mime_type = resp.headers['content-type']
115116
if not mime_type or mime_type.split('/')[0] != 'image':

0 commit comments

Comments
 (0)