176 lines
6.6 KiB
Diff
176 lines
6.6 KiB
Diff
diff --unified --recursive '--exclude=.pylint-disable.patch' original/api/api_activity.py patched/api/api_activity.py
|
|
--- original/api/api_activity.py
|
|
+++ patched/api/api_activity.py
|
|
@@ -32,7 +32,7 @@
|
|
"""
|
|
return self._client.post("/activities/purge.json", **kwds)["result"]
|
|
|
|
-class ApiActivity(ApiBase):
|
|
+class ApiActivity(ApiBase): # pylint: disable=too-few-public-methods
|
|
""" Definitions of /activity/ API endpoints """
|
|
def view(self, activity, **kwds):
|
|
"""
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/api/api_album.py patched/api/api_album.py
|
|
--- original/api/api_album.py
|
|
+++ patched/api/api_album.py
|
|
@@ -7,7 +7,7 @@
|
|
from trovebox.objects.album import Album
|
|
from .api_base import ApiBase
|
|
|
|
-class ApiAlbums(ApiBase):
|
|
+class ApiAlbums(ApiBase): # pylint: disable=too-few-public-methods
|
|
""" Definitions of /albums/ API endpoints """
|
|
def list(self, **kwds):
|
|
"""
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/api/api_base.py patched/api/api_base.py
|
|
--- original/api/api_base.py
|
|
+++ patched/api/api_base.py
|
|
@@ -2,12 +2,12 @@
|
|
api_base.py: Base class for all API classes
|
|
"""
|
|
try:
|
|
- from urllib.parse import quote # Python3
|
|
+ from urllib.parse import quote # Python3 # pylint: disable=import-error,no-name-in-module
|
|
except ImportError:
|
|
from urllib import quote # Python2
|
|
|
|
|
|
-class ApiBase(object):
|
|
+class ApiBase(object): # pylint: disable=too-few-public-methods
|
|
""" Base class for all API objects """
|
|
def __init__(self, client):
|
|
self._client = client
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/api/api_tag.py patched/api/api_tag.py
|
|
--- original/api/api_tag.py
|
|
+++ patched/api/api_tag.py
|
|
@@ -4,7 +4,7 @@
|
|
from trovebox.objects.tag import Tag
|
|
from .api_base import ApiBase
|
|
|
|
-class ApiTags(ApiBase):
|
|
+class ApiTags(ApiBase): # pylint: disable=too-few-public-methods
|
|
""" Definitions of /tags/ API endpoints """
|
|
def list(self, **kwds):
|
|
"""
|
|
Only in patched/api: api_tag.py.~5~
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/auth.py patched/auth.py
|
|
--- original/auth.py
|
|
+++ patched/auth.py
|
|
@@ -5,13 +5,13 @@
|
|
import os
|
|
import io
|
|
try:
|
|
- from configparser import ConfigParser # Python3
|
|
+ from configparser import ConfigParser # Python3 # pylint: disable=import-error
|
|
except ImportError:
|
|
from ConfigParser import SafeConfigParser as ConfigParser # Python2
|
|
|
|
-class Auth(object):
|
|
+class Auth(object): # pylint: disable=too-few-public-methods
|
|
"""OAuth secrets"""
|
|
- def __init__(self, config_file, host,
|
|
+ def __init__(self, config_file, host, # pylint: disable=too-many-arguments
|
|
consumer_key, consumer_secret,
|
|
token, token_secret):
|
|
if host is None:
|
|
@@ -66,7 +66,7 @@
|
|
parser = ConfigParser()
|
|
parser.optionxform = str # Case-sensitive options
|
|
try:
|
|
- parser.read_file(buf) # Python3
|
|
+ parser.read_file(buf) # Python3 # pylint: disable=maybe-no-member
|
|
except AttributeError:
|
|
parser.readfp(buf) # Python2
|
|
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/http.py patched/http.py
|
|
--- original/http.py
|
|
+++ patched/http.py
|
|
@@ -7,7 +7,7 @@
|
|
import requests_oauthlib
|
|
import logging
|
|
try:
|
|
- from urllib.parse import urlparse, urlunparse # Python3
|
|
+ from urllib.parse import urlparse, urlunparse # Python3 # pylint: disable=import-error,no-name-in-module
|
|
except ImportError:
|
|
from urlparse import urlparse, urlunparse # Python2
|
|
|
|
@@ -16,9 +16,9 @@
|
|
from .auth import Auth
|
|
|
|
if sys.version < '3':
|
|
- TEXT_TYPE = unicode
|
|
+ TEXT_TYPE = unicode # pylint: disable=invalid-name
|
|
else: # pragma: no cover
|
|
- TEXT_TYPE = str
|
|
+ TEXT_TYPE = str # pylint: disable=invalid-name
|
|
|
|
DUPLICATE_RESPONSE = {"code": 409,
|
|
"message": "This photo already exists"}
|
|
@@ -37,7 +37,7 @@
|
|
"ssl_verify" : True,
|
|
}
|
|
|
|
- def __init__(self, config_file=None, host=None,
|
|
+ def __init__(self, config_file=None, host=None, # pylint: disable=too-many-arguments
|
|
consumer_key='', consumer_secret='',
|
|
token='', token_secret='', api_version=None):
|
|
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/__init__.py patched/__init__.py
|
|
--- original/__init__.py
|
|
+++ patched/__init__.py
|
|
@@ -13,7 +13,7 @@
|
|
|
|
LATEST_API_VERSION = 2
|
|
|
|
-class Trovebox(Http):
|
|
+class Trovebox(Http): # pylint: disable=too-many-instance-attributes
|
|
"""
|
|
Client library for Trovebox
|
|
If no parameters are specified, config is loaded from the default
|
|
@@ -25,7 +25,7 @@
|
|
This should be used to ensure that your application will continue to work
|
|
even if the Trovebox API is updated to a new revision.
|
|
"""
|
|
- def __init__(self, config_file=None, host=None,
|
|
+ def __init__(self, config_file=None, host=None, # pylint: disable=too-many-arguments
|
|
consumer_key='', consumer_secret='',
|
|
token='', token_secret='',
|
|
api_version=None):
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/main.py patched/main.py
|
|
--- original/main.py
|
|
+++ patched/main.py
|
|
@@ -26,7 +26,7 @@
|
|
|
|
#################################################################
|
|
|
|
-def main(args=sys.argv[1:]):
|
|
+def main(args=sys.argv[1:]): # pylint: disable=too-many-branches
|
|
"""Run the commandline script"""
|
|
usage = "%prog --help"
|
|
parser = OptionParser(usage, add_help_option=False)
|
|
@@ -85,11 +85,11 @@
|
|
sys.exit(1)
|
|
|
|
if options.method == "GET":
|
|
- result = client.get(options.endpoint, process_response=False,
|
|
+ result = client.get(options.endpoint, process_response=False, # pylint: disable=star-args
|
|
**params)
|
|
else:
|
|
params, files = extract_files(params)
|
|
- result = client.post(options.endpoint, process_response=False,
|
|
+ result = client.post(options.endpoint, process_response=False, # pylint: disable=star-args
|
|
files=files, **params)
|
|
for file_ in files:
|
|
files[file_].close()
|
|
diff --unified --recursive '--exclude=.pylint-disable.patch' original/objects/trovebox_object.py patched/objects/trovebox_object.py
|
|
--- original/objects/trovebox_object.py
|
|
+++ patched/objects/trovebox_object.py
|
|
@@ -9,7 +9,7 @@
|
|
""" Base object supporting the storage of custom fields as attributes """
|
|
_type = "None"
|
|
def __init__(self, client, json_dict):
|
|
- self.id = None
|
|
+ self.id = None # pylint: disable=invalid-name
|
|
self.name = None
|
|
self._client = client
|
|
self._json_dict = json_dict
|