1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-11-04 09:22:29 +01:00

Better pylint invocation

This commit is contained in:
Alexander Graf 2016-06-26 13:13:59 +02:00
parent 1543baf034
commit b1f4fd2788
2 changed files with 6 additions and 3 deletions

View File

@ -8,4 +8,4 @@ python:
install:
- pip install pylint requests
script:
- python3 -m pylint -r n -d bad-whitespace,bad-continuation,missing-docstring,anomalous-backslash-in-string,invalid-name,multiple-imports,dangerous-default-value --max-args=8 --max-locals=16 --max-branches=20 --max-nested-blocks=6 instagram
- python3 -m pylint -r n -d bad-whitespace,bad-continuation,missing-docstring,anomalous-backslash-in-string,invalid-name,multiple-imports,dangerous-default-value,locally-disabled instagram

View File

@ -184,6 +184,9 @@ def get_session(user, passwd, EmptySessionOnly=False, session=None):
def download(name, username = None, password = None, sessionfile = None, \
ProfilePicOnly = False, DownloadVideos = True, FastUpdate = False, SleepMinMax=[0.25,2]):
# pylint:disable=too-many-arguments,too-many-locals,too-many-nested-blocks,too-many-branches
# We are aware that this function has many arguments, many local variables, many nested blocks
# and many branches. But we don't care.
session = load_object(sessionfile)
data = get_json(name, session=session)
if len(data["entry_data"]) == 0:
@ -211,14 +214,14 @@ def download(name, username = None, password = None, sessionfile = None, \
if not status:
raise DownloaderException("aborting due to login error")
data = get_json(name, session=session)
if (not "nodes" in data["entry_data"]["ProfilePage"][0]["user"]["media"] \
if ("nodes" not in data["entry_data"]["ProfilePage"][0]["user"]["media"] \
or len(data["entry_data"]["ProfilePage"][0]["user"]["media"]["nodes"]) == 0) \
and not ProfilePicOnly:
raise DownloaderException("no pics found")
totalcount = data["entry_data"]["ProfilePage"][0]["user"]["media"]["count"]
if not ProfilePicOnly:
count = 1
while not get_last_id(data) is None:
while get_last_id(data) is not None:
for node in data["entry_data"]["ProfilePage"][0]["user"]["media"]["nodes"]:
log("[%3i/%3i] " % (count, totalcount), end="", flush=True)
count = count + 1