Skip to content

Commit

Permalink
Flake8 the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jun 8, 2017
1 parent eb754a4 commit 1490b4e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -4,5 +4,5 @@ ignore =
bootstrap.py

[flake8]
ignore = N801,N802,N803,N805,N806,N812,E301
ignore = E301
exclude = bootstrap.py
6 changes: 2 additions & 4 deletions src/Products/PythonScripts/PythonScript.py
Expand Up @@ -20,18 +20,15 @@
import marshal
import os
import re
import six
from six.moves.urllib.parse import quote
import sys
import traceback
from types import FunctionType

from AccessControl.class_init import InitializeClass
from AccessControl.requestmethod import requestmethod
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.ZopeGuards import get_safe_globals, guarded_getattr
from AccessControl.ZopeGuards import get_safe_globals, guarded_getattr
from Acquisition import aq_parent
from App.Common import package_home
from App.Dialogs import MessageDialog
Expand Down Expand Up @@ -175,7 +172,7 @@ def ZPythonScriptHTML_upload(self, REQUEST, file=''):
if self.wl_isLocked():
raise ResourceLockedError("The script is locked via WebDAV.")

if not instance(file, str):
if not isinstance(file, str):
if not file:
raise ValueError('File not specified')
file = file.read()
Expand Down Expand Up @@ -549,6 +546,7 @@ def document_src(self, REQUEST=None, RESPONSE=None):
RESPONSE.setHeader('Content-Type', 'text/plain')
return self.read()


InitializeClass(PythonScript)


Expand Down
1 change: 1 addition & 0 deletions src/Products/PythonScripts/standard.py
Expand Up @@ -108,4 +108,5 @@ def __hash__(self):
def Object(**kw):
return _Object(**kw)


security.apply(globals())
1 change: 1 addition & 0 deletions src/Products/PythonScripts/tests/testBindings.py
Expand Up @@ -94,6 +94,7 @@ def __repr__(self):
def methodWithRoles(self):
return 'method called'


InitializeClass(FauxFolder)


Expand Down
7 changes: 7 additions & 0 deletions tox.ini
@@ -1,5 +1,6 @@
[tox]
envlist =
flake8,
py27,
py34,
py35,
Expand All @@ -14,3 +15,9 @@ skip_install = true
deps =
setuptools==33.1.1
zc.buildout

[testenv:flake8]
basepython = python2.7
deps = flake8
skip_install = true
commands = flake8 --doctests src setup.py

0 comments on commit 1490b4e

Please sign in to comment.