238 lines
8.3 KiB
Diff
238 lines
8.3 KiB
Diff
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_album.py patched/api_album.py
|
|
--- original/api_album.py 2013-08-16 18:12:30.434212000 +0100
|
|
+++ patched/api_album.py 2013-08-16 18:13:29.678506001 +0100
|
|
@@ -3,7 +3,7 @@
|
|
"""
|
|
from .objects import Album
|
|
|
|
-class ApiAlbums(object):
|
|
+class ApiAlbums(object): # pylint: disable=R0903,C0111
|
|
def __init__(self, client):
|
|
self._client = client
|
|
|
|
@@ -12,7 +12,7 @@
|
|
results = self._client.get("/albums/list.json", **kwds)["result"]
|
|
return [Album(self._client, album) for album in results]
|
|
|
|
-class ApiAlbum(object):
|
|
+class ApiAlbum(object): # pylint: disable=C0111
|
|
def __init__(self, client):
|
|
self._client = client
|
|
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_photo.py patched/api_photo.py
|
|
--- original/api_photo.py 2013-08-16 18:12:30.434212000 +0100
|
|
+++ patched/api_photo.py 2013-08-16 18:13:29.678506001 +0100
|
|
@@ -20,7 +20,7 @@
|
|
ids.append(photo)
|
|
return ids
|
|
|
|
-class ApiPhotos(object):
|
|
+class ApiPhotos(object): # pylint: disable=C0111
|
|
def __init__(self, client):
|
|
self._client = client
|
|
|
|
@@ -54,7 +54,7 @@
|
|
raise TroveboxError("Delete response returned False")
|
|
return True
|
|
|
|
-class ApiPhoto(object):
|
|
+class ApiPhoto(object): # pylint: disable=C0111
|
|
def __init__(self, client):
|
|
self._client = client
|
|
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_tag.py patched/api_tag.py
|
|
--- original/api_tag.py 2013-08-16 18:12:30.434212000 +0100
|
|
+++ patched/api_tag.py 2013-08-16 18:13:29.678506001 +0100
|
|
@@ -3,7 +3,7 @@
|
|
"""
|
|
from .objects import Tag
|
|
|
|
-class ApiTags(object):
|
|
+class ApiTags(object): # pylint: disable=R0903,C0111
|
|
def __init__(self, client):
|
|
self._client = client
|
|
|
|
@@ -12,7 +12,7 @@
|
|
results = self._client.get("/tags/list.json", **kwds)["result"]
|
|
return [Tag(self._client, tag) for tag in results]
|
|
|
|
-class ApiTag(object):
|
|
+class ApiTag(object): # pylint: disable=C0111
|
|
def __init__(self, client):
|
|
self._client = client
|
|
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/auth.py patched/auth.py
|
|
--- original/auth.py 2013-08-16 18:13:24.966482000 +0100
|
|
+++ patched/auth.py 2013-08-16 18:13:51.766615537 +0100
|
|
@@ -4,7 +4,7 @@
|
|
from __future__ import unicode_literals
|
|
import os
|
|
try:
|
|
- from configparser import ConfigParser # Python3
|
|
+ from configparser import ConfigParser # Python3 # pylint: disable=F0401
|
|
except ImportError:
|
|
from ConfigParser import SafeConfigParser as ConfigParser # Python2
|
|
try:
|
|
@@ -12,9 +12,9 @@
|
|
except ImportError:
|
|
import StringIO as io # Python2
|
|
|
|
-class Auth(object):
|
|
+class Auth(object): # pylint: disable=R0903
|
|
"""OAuth secrets"""
|
|
- def __init__(self, config_file, host,
|
|
+ def __init__(self, config_file, host, # pylint: disable=R0913
|
|
consumer_key, consumer_secret,
|
|
token, token_secret):
|
|
if host is None:
|
|
@@ -69,7 +69,7 @@
|
|
parser = ConfigParser()
|
|
parser.optionxform = str # Case-sensitive options
|
|
try:
|
|
- parser.read_file(buf) # Python3
|
|
+ parser.read_file(buf) # Python3 # pylint: disable=E1103
|
|
except AttributeError:
|
|
parser.readfp(buf) # Python2
|
|
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/http.py patched/http.py
|
|
--- original/http.py 2013-08-16 17:54:30.688858000 +0100
|
|
+++ patched/http.py 2013-08-16 18:14:14.106726301 +0100
|
|
@@ -7,18 +7,18 @@
|
|
import requests_oauthlib
|
|
import logging
|
|
try:
|
|
- from urllib.parse import urlparse, urlunparse # Python3
|
|
+ from urllib.parse import urlparse, urlunparse # Python3 # pylint: disable=F0401,E0611
|
|
except ImportError:
|
|
from urlparse import urlparse, urlunparse # Python2
|
|
|
|
from .objects import TroveboxObject
|
|
-from .errors import *
|
|
+from .errors import * # pylint: disable=W0401
|
|
from .auth import Auth
|
|
|
|
if sys.version < '3':
|
|
- TEXT_TYPE = unicode
|
|
+ TEXT_TYPE = unicode # pylint: disable=C0103
|
|
else:
|
|
- TEXT_TYPE = str
|
|
+ TEXT_TYPE = str # pylint: disable=C0103
|
|
|
|
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=R0913
|
|
consumer_key='', consumer_secret='',
|
|
token='', token_secret='', api_version=None):
|
|
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/__init__.py patched/__init__.py
|
|
--- original/__init__.py 2013-08-16 18:12:30.438212000 +0100
|
|
+++ patched/__init__.py 2013-08-16 18:13:29.678506001 +0100
|
|
@@ -2,7 +2,7 @@
|
|
__init__.py : Trovebox package top level
|
|
"""
|
|
from .http import Http
|
|
-from .errors import *
|
|
+from .errors import * # pylint: disable=W0401
|
|
from ._version import __version__
|
|
from . import api_photo
|
|
from . import api_tag
|
|
@@ -22,7 +22,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=R0913
|
|
consumer_key='', consumer_secret='',
|
|
token='', token_secret='',
|
|
api_version=None):
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/main.py patched/main.py
|
|
--- original/main.py 2013-08-16 18:12:30.438212000 +0100
|
|
+++ patched/main.py 2013-08-16 18:13:29.678506001 +0100
|
|
@@ -26,7 +26,7 @@
|
|
|
|
#################################################################
|
|
|
|
-def main(args=sys.argv[1:]):
|
|
+def main(args=sys.argv[1:]): # pylint: disable=R0912,C0111
|
|
usage = "%prog --help"
|
|
parser = OptionParser(usage, add_help_option=False)
|
|
parser.add_option('-c', '--config', help="Configuration file to use",
|
|
@@ -84,13 +84,13 @@
|
|
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=W0142
|
|
**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=W0142
|
|
files=files, **params)
|
|
- for f in files:
|
|
+ for f in files: # pylint: disable=C0103
|
|
files[f].close()
|
|
|
|
if options.verbose:
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/objects.py patched/objects.py
|
|
--- original/objects.py 2013-08-16 18:12:30.438212000 +0100
|
|
+++ patched/objects.py 2013-08-16 18:13:29.682506021 +0100
|
|
@@ -2,16 +2,16 @@
|
|
objects.py : Basic Trovebox API Objects
|
|
"""
|
|
try:
|
|
- from urllib.parse import quote # Python3
|
|
+ from urllib.parse import quote # Python3 # pylint: disable=F0401,E0611
|
|
except ImportError:
|
|
from urllib import quote # Python2
|
|
|
|
from .errors import TroveboxError
|
|
|
|
-class TroveboxObject(object):
|
|
+class TroveboxObject(object): # pylint: disable=R0903
|
|
""" Base object supporting the storage of custom fields as attributes """
|
|
def __init__(self, trovebox, json_dict):
|
|
- self.id = None
|
|
+ self.id = None # pylint: disable=C0103
|
|
self.name = None
|
|
self._trovebox = trovebox
|
|
self._json_dict = json_dict
|
|
@@ -57,7 +57,7 @@
|
|
return self._json_dict
|
|
|
|
|
|
-class Photo(TroveboxObject):
|
|
+class Photo(TroveboxObject): # pylint: disable=C0111
|
|
def delete(self, **kwds):
|
|
"""
|
|
Delete this photo.
|
|
@@ -147,7 +147,7 @@
|
|
|
|
self._replace_fields(new_dict)
|
|
|
|
-class Tag(TroveboxObject):
|
|
+class Tag(TroveboxObject): # pylint: disable=C0111
|
|
def delete(self, **kwds):
|
|
"""
|
|
Delete this tag.
|
|
@@ -168,7 +168,7 @@
|
|
self._replace_fields(new_dict)
|
|
|
|
|
|
-class Album(TroveboxObject):
|
|
+class Album(TroveboxObject): # pylint: disable=C0111
|
|
def __init__(self, trovebox, json_dict):
|
|
self.photos = None
|
|
self.cover = None
|
|
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/_version.py patched/_version.py
|
|
--- original/_version.py 2013-08-16 18:12:30.438212000 +0100
|
|
+++ patched/_version.py 2013-08-16 18:13:29.682506021 +0100
|
|
@@ -1,2 +1,2 @@
|
|
-
|
|
+ # pylint: disable=C0111
|
|
__version__ = "0.4"
|