Skip to content

Commit 3dc9e36

Browse files
authored
isort, black and 2to3
1 parent 34be34b commit 3dc9e36

6 files changed

Lines changed: 12 additions & 22 deletions

File tree

discogs_cli/discogs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
from __future__ import unicode_literals
43

54
import click
5+
from discogs_client import Client
66

77
from .__init__ import __version__
8-
from discogs_client import Client
98

109

11-
class Discogs(object):
10+
class Discogs:
1211
"""Wraps the discogs_client library. Encapsulating Search, Artist
1312
Release, Master, Label objects. Utility functionality in order to
1413
render output for terminal consumption.

discogs_cli/ext/completer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
# ANY KIND, either express or implied. See the License for the specific
1414
# language governing permissions and limitations under the License.
1515

16-
from __future__ import unicode_literals
17-
from __future__ import print_function
1816

1917
from prompt_toolkit.completion import Completer
2018

21-
from ..completions import SUBCOMMANDS, ARGS_OPTS_LOOKUP
19+
from ..completions import ARGS_OPTS_LOOKUP, SUBCOMMANDS
2220

2321

2422
class Completer(Completer):
@@ -107,7 +105,7 @@ def completing_subcommand_option(self, words, word_before_cursor):
107105
:return: A list of options.
108106
"""
109107
options = []
110-
for subcommand, args_opts in ARGS_OPTS_LOOKUP.items():
108+
for subcommand, _ in list(ARGS_OPTS_LOOKUP.items()):
111109
if subcommand in words and (
112110
words[-2] == subcommand
113111
or self.completing_subcommand_option_util(subcommand, words)
@@ -151,7 +149,7 @@ def arg_completions(self, words, word_before_cursor):
151149
"""
152150
if "ogs" not in words:
153151
return []
154-
for subcommand, args_opts in ARGS_OPTS_LOOKUP.items():
152+
for subcommand, _ in list(ARGS_OPTS_LOOKUP.items()):
155153
if subcommand in words:
156154
return [ARGS_OPTS_LOOKUP[subcommand]["args"]]
157155
return ["10"]

discogs_cli/ext/utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313
# ANY KIND, either express or implied. See the License for the specific
1414
# language governing permissions and limitations under the License.
1515

16-
from __future__ import unicode_literals
17-
from __future__ import print_function
18-
1916
import re
17+
import shlex
2018

2119
import six
22-
import shlex
2320
from prompt_toolkit.completion import Completion
2421

2522
from ..completions import META_LOOKUP
2623

2724

28-
class TextUtils(object):
25+
class TextUtils:
2926
"""Utilities for parsing and matching text."""
3027

3128
def find_matches(self, word, collection, fuzzy):

discogs_cli/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# -*- coding: utf-8 -*-
22

3-
import click
43
import subprocess
54

5+
import click
66
from prompt_toolkit import prompt
77
from prompt_toolkit.history import InMemoryHistory
88
from prompt_toolkit.lexers import PygmentsLexer
99
from prompt_toolkit.styles.pygments import style_from_pygments_cls
1010
from pygments.styles import get_style_by_name
1111

1212
from .__init__ import __version__
13-
1413
# from .completion import command_completer
1514
from .ext.completer import Completer
16-
from .pyglexer import DiscogsCliLexer
1715
from .ext.utils import TextUtils
16+
from .pyglexer import DiscogsCliLexer
1817

1918
EXIT = ["quit", "exit", "logoff", "sys64738"]
2019
TOKEN = "ogs "

discogs_cli/main_cli.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
import click
43
import os
54

6-
from .discogs import Release, Artist, Label, Search, Master
7-
8-
import requests
5+
import click
96

10-
requests.packages.urllib3.disable_warnings()
7+
from .discogs import Artist, Label, Master, Release, Search
118

129

1310
@click.group()

discogs_cli/pyglexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pygments.lexer import RegexLexer, bygroups
2-
from pygments.token import Text, String, Keyword, Operator
2+
from pygments.token import Keyword, Operator, String, Text
33

44
__all__ = ["DiscogsCliLexer"]
55

0 commit comments

Comments
 (0)