jenkins-bot has submitted this change and it was merged.
Change subject: Remove flake8: noqa
......................................................................
Remove flake8: noqa
flake8: noqa disables all flakes in the module. 'noqa' should be
used to only disable flakes on the line it appears.
Change-Id: I2b9ba97f44176d2d8550951718599c32a3a58e88
---
M scripts/maintenance/cache.py
M setup.py
2 files changed, 31 insertions(+), 29 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 603d50f..15dbc88 100644
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-"""
+r"""
This script runs commands on each entry in the API caches.
Syntax: cache.py [-password] [-delete] [-c '...'] [dir ...]
@@ -53,15 +53,18 @@
import pywikibot
from pywikibot.data import api
-from pywikibot.site import APISite, DataSite, LoginStatus # flake8: noqa
-from pywikibot.page import User # flake8: noqa
+from pywikibot.site import APISite, DataSite, LoginStatus # noqa
+from pywikibot.page import User # noqa
class ParseError(Exception):
+
""" Error parsing. """
class CacheEntry(api.CachedRequest):
+
+ """A Request cache entry."""
def __init__(self, directory, filename):
""" Constructor. """
@@ -94,7 +97,6 @@
def parse_key(self):
""" Parse the key loaded from the cache entry. """
-
# find the start of the first parameter
start = self.key.index('(')
# find the end of the first object
@@ -171,20 +173,23 @@
os.remove(self._cachefile_path())
-def process_entries(cache_path, func):
- """ Check the contents of the cache. """
+def process_entries(cache_path, func, use_accesstime=None):
+ """
+ Check the contents of the cache.
- # This program tries to use file access times to determine
- # whether cache files are being used.
- # However file access times are not always usable.
- # On many modern filesystems, they have been disabled.
- # On unix, check the filesystem mount options. You may
- # need to remount with 'strictatime'.
- # - None = detect
- # - False = dont use
- # - True = always use
- use_accesstime = None
+ This program tries to use file access times to determine
+ whether cache files are being used.
+ However file access times are not always usable.
+ On many modern filesystems, they have been disabled.
+ On unix, check the filesystem mount options. You may
+ need to remount with 'strictatime'.
+ @param use_accesstime: Whether access times should be used.
+ @type use_accesstime: bool tristate:
+ - None = detect
+ - False = dont use
+ - True = always use
+ """
if not cache_path:
cache_path = os.path.join(pywikibot.config2.base_dir, 'apicache')
@@ -237,25 +242,25 @@
def has_password(entry):
- """ has a password in the entry """
+ """ Entry has a password in the entry. """
if 'lgpassword' in entry._uniquedescriptionstr():
return entry
def is_logout(entry):
- """ is a logout entry """
+ """ Entry is a logout entry. """
if not entry._data and 'logout' in entry.key:
return entry
def empty_response(entry):
- """ has no data """
+ """ Entry has no data. """
if not entry._data and 'logout' not in entry.key:
return entry
def not_accessed(entry):
- """ has never been accessed """
+ """ Entry has never been accessed. """
if not hasattr(entry, 'stinfo'):
return
diff --git a/setup.py b/setup.py
index 1baafb7..abc1e6b 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
-"""
-Installer script for Pywikibot 2.0 framework
-"""
+"""Installer script for Pywikibot 2.0 framework."""
#
# (C) Pywikibot team, 2009-2013
#
@@ -37,7 +35,7 @@
# however it is available with setuptools.
}
-dependency_links=[
+dependency_links = [
'https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format=gz#egg=httplib2-0.8-pywikibot1',
'git+https://github.com/AlereDevices/lunatic-python.git#egg=lunatic-python',
'git+https://github.com/jayvdb/parse-crontab.git#egg=crontab',
@@ -48,7 +46,7 @@
raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 or
higher")
elif sys.version_info[1] == 6:
# work around distutils hardcoded unittest dependency
- import unittest # flake8: noqa
+ import unittest # noqa
if 'test' in sys.argv and sys.version_info < (2, 7):
import unittest2
sys.modules['unittest'] = unittest2
@@ -99,10 +97,9 @@
maintainer='The pywikibot team',
maintainer_email='[email protected]',
license='MIT License',
- packages=['pywikibot'] +
- [package
- for package in find_packages()
- if package.startswith('pywikibot.')],
+ packages=['pywikibot'] + [package
+ for package in find_packages()
+ if package.startswith('pywikibot.')],
install_requires=dependencies,
dependency_links=dependency_links,
extras_require=extra_deps,
--
To view, visit https://gerrit.wikimedia.org/r/170581
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2b9ba97f44176d2d8550951718599c32a3a58e88
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits