Add docstrings to the top of each file, since these are not easily ignored in Pylint

This commit is contained in:
Pete 2013-08-12 18:06:22 +01:00 committed by sneakypete81
parent 927e895c9b
commit 32965c716e
11 changed files with 97 additions and 58 deletions

View file

@ -1,8 +1,8 @@
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_album.py patched/api_album.py
--- original/api_album.py 2013-08-12 17:24:58.207574000 +0100
+++ patched/api_album.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,6 +1,7 @@
+ # pylint: disable=C0111
--- original/api_album.py 2013-08-12 18:02:57.510877000 +0100
+++ patched/api_album.py 2013-08-12 18:03:40.123088539 +0100
@@ -3,7 +3,7 @@
"""
from .objects import Album
-class ApiAlbums(object):
@ -10,7 +10,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_album.
def __init__(self, client):
self._client = client
@@ -9,7 +10,7 @@
@@ -12,7 +12,7 @@
results = self._client.get("/albums/list.json", **kwds)["result"]
return [Album(self._client, album) for album in results]
@ -20,14 +20,9 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_album.
self._client = client
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_photo.py patched/api_photo.py
--- original/api_photo.py 2013-08-12 17:24:58.207574000 +0100
+++ patched/api_photo.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,3 +1,4 @@
+ # pylint: disable=C0111
import base64
from .errors import TroveboxError
@@ -17,7 +18,7 @@
--- original/api_photo.py 2013-08-12 18:02:57.510877000 +0100
+++ patched/api_photo.py 2013-08-12 18:03:40.123088539 +0100
@@ -20,7 +20,7 @@
ids.append(photo)
return ids
@ -36,7 +31,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_photo.
def __init__(self, client):
self._client = client
@@ -51,7 +52,7 @@
@@ -54,7 +54,7 @@
raise TroveboxError("Delete response returned False")
return True
@ -46,10 +41,10 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_photo.
self._client = client
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_tag.py patched/api_tag.py
--- original/api_tag.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/api_tag.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,6 +1,7 @@
+ # pylint: disable=C0111
--- original/api_tag.py 2013-08-12 18:02:57.510877000 +0100
+++ patched/api_tag.py 2013-08-12 18:03:40.123088539 +0100
@@ -3,7 +3,7 @@
"""
from .objects import Tag
-class ApiTags(object):
@ -57,7 +52,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_tag.py
def __init__(self, client):
self._client = client
@@ -9,7 +10,7 @@
@@ -12,7 +12,7 @@
results = self._client.get("/tags/list.json", **kwds)["result"]
return [Tag(self._client, tag) for tag in results]
@ -67,10 +62,9 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/api_tag.py
self._client = client
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/config.py patched/config.py
--- original/config.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/config.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,7 +1,8 @@
+ # pylint: disable=C0111
--- original/config.py 2013-08-12 18:02:57.510877000 +0100
+++ patched/config.py 2013-08-12 18:03:40.123088539 +0100
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import os
try:
@ -79,7 +73,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/config.py
except ImportError:
from ConfigParser import SafeConfigParser as ConfigParser # Python2
try:
@@ -9,8 +10,8 @@
@@ -12,8 +12,8 @@
except ImportError:
import StringIO as io # Python2
@ -90,7 +84,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/config.py
consumer_key, consumer_secret,
token, token_secret):
if host is None:
@@ -65,7 +66,7 @@
@@ -68,7 +68,7 @@
parser = ConfigParser()
parser.optionxform = str # Case-sensitive options
try:
@ -99,18 +93,10 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/config.py
except AttributeError:
parser.readfp(buf) # Python2
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/errors.py patched/errors.py
--- original/errors.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/errors.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,3 +1,4 @@
+ # pylint: disable=C0111
class TroveboxError(Exception):
""" Indicates that an Trovebox operation failed """
pass
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/http.py patched/http.py
--- original/http.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/http.py 2013-08-12 17:27:23.828296874 +0100
@@ -4,18 +4,18 @@
--- original/http.py 2013-08-12 18:02:57.510877000 +0100
+++ patched/http.py 2013-08-12 18:03:40.123088539 +0100
@@ -7,18 +7,18 @@
import requests_oauthlib
import logging
try:
@ -133,7 +119,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/http.py pa
DUPLICATE_RESPONSE = {"code": 409,
"message": "This photo already exists"}
@@ -32,7 +32,7 @@
@@ -35,7 +35,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.
"""
@ -143,17 +129,18 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/http.py pa
token='', token_secret='', api_version=None):
self._api_version = api_version
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/__init__.py patched/__init__.py
--- original/__init__.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/__init__.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,5 +1,6 @@
+ # pylint: disable=C0111
--- original/__init__.py 2013-08-12 18:02:57.514877000 +0100
+++ patched/__init__.py 2013-08-12 18:03:40.123088539 +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
@@ -19,7 +20,7 @@
@@ -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.
"""
@ -163,14 +150,9 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/__init__.p
token='', token_secret='',
api_version=None):
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/main.py patched/main.py
--- original/main.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/main.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,3 +1,4 @@
+ # pylint: disable=C0111
#!/usr/bin/env python
import os
import sys
@@ -23,7 +24,7 @@
--- original/main.py 2013-08-12 18:02:57.514877000 +0100
+++ patched/main.py 2013-08-12 18:03:40.123088539 +0100
@@ -26,7 +26,7 @@
#################################################################
@ -179,7 +161,7 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/main.py pa
usage = "%prog --help"
parser = OptionParser(usage, add_help_option=False)
parser.add_option('-c', '--config', help="Configuration file to use",
@@ -81,13 +82,13 @@
@@ -84,13 +84,13 @@
sys.exit(1)
if options.method == "GET":
@ -197,10 +179,11 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/main.py pa
if options.verbose:
diff --unified --recursive '--exclude=.pylint-ignores.patch' original/objects.py patched/objects.py
--- original/objects.py 2013-08-12 17:24:58.211574000 +0100
+++ patched/objects.py 2013-08-12 17:27:10.872232623 +0100
@@ -1,14 +1,15 @@
+ # pylint: disable=C0111
--- original/objects.py 2013-08-12 18:03:37.079073000 +0100
+++ patched/objects.py 2013-08-12 18:04:00.723190687 +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
@ -218,9 +201,37 @@ diff --unified --recursive '--exclude=.pylint-ignores.patch' original/objects.py
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-12 17:24:58.211574000 +0100
+++ patched/_version.py 2013-08-12 17:27:10.872232623 +0100
@@ -1 +1,2 @@
--- original/_version.py 2013-08-12 18:02:57.514877000 +0100
+++ patched/_version.py 2013-08-12 18:03:40.127088555 +0100
@@ -1,2 +1,2 @@
-
+ # pylint: disable=C0111
__version__ = "0.4"

View file

@ -1,3 +1,6 @@
"""
__init__.py : Trovebox package top level
"""
from .http import Http
from .errors import *
from ._version import __version__

View file

@ -1 +1,2 @@
__version__ = "0.4"

View file

@ -1,3 +1,6 @@
"""
api_album.py : Trovebox Album API Classes
"""
from .objects import Album
class ApiAlbums(object):

View file

@ -1,3 +1,6 @@
"""
api_photo.py : Trovebox Photo API Classes
"""
import base64
from .errors import TroveboxError

View file

@ -1,3 +1,6 @@
"""
api_tag.py : Trovebox Tag API Classes
"""
from .objects import Tag
class ApiTags(object):

View file

@ -1,3 +1,6 @@
"""
config.py : OAuth Config File Parser
"""
from __future__ import unicode_literals
import os
try:

View file

@ -1,3 +1,6 @@
"""
errors.py : Trovebox Error Classes
"""
class TroveboxError(Exception):
""" Indicates that an Trovebox operation failed """
pass

View file

@ -1,3 +1,6 @@
"""
http.py : Trovebox HTTP Access
"""
from __future__ import unicode_literals
import sys
import requests

View file

@ -1,4 +1,7 @@
#!/usr/bin/env python
"""
main.py : Trovebox Console Script
"""
import os
import sys
import json

View file

@ -1,3 +1,6 @@
"""
objects.py : Basic Trovebox API Objects
"""
try:
from urllib.parse import quote # Python3
except ImportError: