Skip to content

Commit ff3a639

Browse files
committed
Add type annotations
1 parent 7b392bd commit ff3a639

File tree

17 files changed

+380
-250
lines changed

17 files changed

+380
-250
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
include_package_data=True,
3333
package_data={"": ["cacerts.txt", "cacert.pem"]},
3434
zip_safe=False,
35-
python_requires=">=3.7.0",
35+
python_requires=">=3.9.0",
3636
classifiers=[
3737
"Development Status :: 5 - Production/Stable",
3838
"Intended Audience :: Developers",

shotgun_api3/lib/httplib2/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
from .. import six
23

34
# Define all here to keep linters happy. It should be overwritten by the code

shotgun_api3/lib/httplib2/auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
import base64
23
import re
34

shotgun_api3/lib/httplib2/certs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
"""Utilities for certificate management."""
23

34
import os

shotgun_api3/lib/httplib2/iri2uri.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# type: ignore
23
"""Converts an IRI to a URI."""
34

45
__author__ = "Joe Gregorio ([email protected])"

shotgun_api3/lib/httplib2/python3/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# type: ignore
23
"""Small, fast HTTP client library for Python."""
34

45
__author__ = "Joe Gregorio ([email protected])"

shotgun_api3/lib/httplib2/python3/auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
import base64
23
import re
34

shotgun_api3/lib/httplib2/python3/certs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
"""Utilities for certificate management."""
23

34
import os

shotgun_api3/lib/httplib2/python3/iri2uri.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# type: ignore
23
"""Converts an IRI to a URI."""
34

45
__author__ = "Joe Gregorio ([email protected])"

shotgun_api3/lib/mimetypes.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
a patched version of the native mimetypes module and is used only in Python
2727
versions 2.7.0 - 2.7.9, which included a broken version of the mimetypes module.
2828
"""
29+
from __future__ import print_function
2930

3031
import os
3132
import sys
@@ -568,14 +569,14 @@ def _default_mime_types():
568569
"""
569570

570571
def usage(code, msg=''):
571-
print USAGE
572-
if msg: print msg
572+
print(USAGE)
573+
if msg: print(msg)
573574
sys.exit(code)
574575

575576
try:
576577
opts, args = getopt.getopt(sys.argv[1:], 'hle',
577578
['help', 'lenient', 'extension'])
578-
except getopt.error, msg:
579+
except getopt.error as msg:
579580
usage(1, msg)
580581

581582
strict = 1
@@ -590,9 +591,9 @@ def usage(code, msg=''):
590591
for gtype in args:
591592
if extension:
592593
guess = guess_extension(gtype, strict)
593-
if not guess: print "I don't know anything about type", gtype
594-
else: print guess
594+
if not guess: print("I don't know anything about type", gtype)
595+
else: print(guess)
595596
else:
596597
guess, encoding = guess_type(gtype, strict)
597-
if not guess: print "I don't know anything about type", gtype
598-
else: print 'type:', guess, 'encoding:', encoding
598+
if not guess: print("I don't know anything about type", gtype)
599+
else: print('type:', guess, 'encoding:', encoding)

0 commit comments

Comments
 (0)