Fixed pep8 issues E701, E203, E231, E261
This commit is contained in:
parent
e0c432f70d
commit
0d589349a1
2 changed files with 35 additions and 35 deletions
|
|
@ -344,7 +344,8 @@ namespace swig
|
||||||
%feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__;
|
%feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__;
|
||||||
#else
|
#else
|
||||||
%extend SwigPyIterator {
|
%extend SwigPyIterator {
|
||||||
%pythoncode {def __iter__(self): return self}
|
%pythoncode {def __iter__(self):
|
||||||
|
return self}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -860,12 +860,12 @@ public:
|
||||||
// Python-2.2 object hack
|
// Python-2.2 object hack
|
||||||
Printv(f_shadow,
|
Printv(f_shadow,
|
||||||
"def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n",
|
"def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n",
|
||||||
tab4, "if (name == \"thisown\"): return self.this.own(value)\n",
|
tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own(value)\n",
|
||||||
tab4, "if (name == \"this\"):\n", tab4, tab4, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n",
|
tab4, "if (name == \"this\"):\n", tab4, tab4, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n",
|
||||||
#ifdef USE_THISOWN
|
#ifdef USE_THISOWN
|
||||||
tab4, tab8, "if hasattr(value,\"thisown\"): self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n",
|
tab4, tab8, "if hasattr(value,\"thisown\"): self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n",
|
||||||
#endif
|
#endif
|
||||||
tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name,None)\n", tab4, "if method: return method(self,value)\n",
|
tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name, None)\n", tab4, "if method:\n", tab4, tab4, "return method(self, value)\n",
|
||||||
#ifdef USE_THISOWN
|
#ifdef USE_THISOWN
|
||||||
tab4, "if (not static) or (name == \"thisown\"):\n",
|
tab4, "if (not static) or (name == \"thisown\"):\n",
|
||||||
#else
|
#else
|
||||||
|
|
@ -878,14 +878,14 @@ public:
|
||||||
|
|
||||||
Printv(f_shadow,
|
Printv(f_shadow,
|
||||||
"def _swig_getattr(self, class_type, name):\n",
|
"def _swig_getattr(self, class_type, name):\n",
|
||||||
tab4, "if (name == \"thisown\"): return self.this.own()\n",
|
tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own()\n",
|
||||||
tab4, "method = class_type.__swig_getmethods__.get(name, None)\n",
|
tab4, "method = class_type.__swig_getmethods__.get(name, None)\n",
|
||||||
tab4, "if method: return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL);
|
tab4, "if method:\n", tab4, tab4, "return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL);
|
||||||
|
|
||||||
Printv(f_shadow,
|
Printv(f_shadow,
|
||||||
"def _swig_repr(self):\n",
|
"def _swig_repr(self):\n",
|
||||||
tab4, "try: strthis = \"proxy of \" + self.this.__repr__()\n",
|
tab4, "try:\n", tab4, tab4, "strthis = \"proxy of \" + self.this.__repr__()\n",
|
||||||
tab4, "except: strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL);
|
tab4, "except:\n", tab4, tab4, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL);
|
||||||
|
|
||||||
if (!classic) {
|
if (!classic) {
|
||||||
/* Usage of types.ObjectType is deprecated.
|
/* Usage of types.ObjectType is deprecated.
|
||||||
|
|
@ -895,7 +895,7 @@ public:
|
||||||
// "import types\n",
|
// "import types\n",
|
||||||
"try:\n",
|
"try:\n",
|
||||||
// " _object = types.ObjectType\n",
|
// " _object = types.ObjectType\n",
|
||||||
" _object = object\n", " _newclass = 1\n", "except AttributeError:\n", " class _object : pass\n", " _newclass = 0\n",
|
tab4, "_object = object\n", tab4, "_newclass = 1\n", "except AttributeError:\n", tab4, "class _object:\n", tab4, tab4, "pass\n", tab4, "_newclass = 0\n",
|
||||||
// "del types\n",
|
// "del types\n",
|
||||||
"\n\n", NIL);
|
"\n\n", NIL);
|
||||||
}
|
}
|
||||||
|
|
@ -3957,7 +3957,7 @@ public:
|
||||||
if (!modern) {
|
if (!modern) {
|
||||||
Printv(f_shadow, tab4, "__swig_setmethods__ = {}\n", NIL);
|
Printv(f_shadow, tab4, "__swig_setmethods__ = {}\n", NIL);
|
||||||
if (Len(base_class)) {
|
if (Len(base_class)) {
|
||||||
Printf(f_shadow, "%sfor _s in [%s]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))\n", tab4, base_class);
|
Printv(f_shadow, tab4, "for _s in [", base_class, "]:\n", tab8, "__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))\n", NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetFlag(n, "feature:python:nondynamic")) {
|
if (!GetFlag(n, "feature:python:nondynamic")) {
|
||||||
|
|
@ -3968,7 +3968,7 @@ public:
|
||||||
|
|
||||||
Printv(f_shadow, tab4, "__swig_getmethods__ = {}\n", NIL);
|
Printv(f_shadow, tab4, "__swig_getmethods__ = {}\n", NIL);
|
||||||
if (Len(base_class)) {
|
if (Len(base_class)) {
|
||||||
Printf(f_shadow, "%sfor _s in [%s]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))\n", tab4, base_class);
|
Printv(f_shadow, tab4, "for _s in [", base_class, "]:\n", tab8, "__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))\n", NIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Printv(f_shadow, tab4, "__getattr__ = lambda self, name: _swig_getattr(self, ", class_name, ", name)\n", NIL);
|
Printv(f_shadow, tab4, "__getattr__ = lambda self, name: _swig_getattr(self, ", class_name, ", name)\n", NIL);
|
||||||
|
|
@ -4056,7 +4056,7 @@ public:
|
||||||
Delete(realct);
|
Delete(realct);
|
||||||
if (!have_constructor) {
|
if (!have_constructor) {
|
||||||
if (!builtin)
|
if (!builtin)
|
||||||
Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs): raise AttributeError(\"", "No constructor defined",
|
Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs):\n", tab8, "raise AttributeError(\"", "No constructor defined",
|
||||||
(Getattr(n, "abstracts") ? " - class is abstract" : ""), "\")\n", NIL);
|
(Getattr(n, "abstracts") ? " - class is abstract" : ""), "\")\n", NIL);
|
||||||
} else if (fastinit && !builtin) {
|
} else if (fastinit && !builtin) {
|
||||||
|
|
||||||
|
|
@ -4094,12 +4094,12 @@ public:
|
||||||
Printv(f_shadow_file, "\nclass ", class_name, "Ptr(", class_name, "):\n", tab4, "def __init__(self, this):\n", NIL);
|
Printv(f_shadow_file, "\nclass ", class_name, "Ptr(", class_name, "):\n", tab4, "def __init__(self, this):\n", NIL);
|
||||||
if (!modern) {
|
if (!modern) {
|
||||||
Printv(f_shadow_file,
|
Printv(f_shadow_file,
|
||||||
tab8, "try: self.this.append(this)\n",
|
tab8, "try:\n", tab8, tab4, "self.this.append(this)\n",
|
||||||
tab8, "except: self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
tab8, "except:\n", tab8, tab4, "self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
||||||
} else {
|
} else {
|
||||||
Printv(f_shadow_file,
|
Printv(f_shadow_file,
|
||||||
tab8, "try: self.this.append(this)\n",
|
tab8, "try:\n", tab8, tab4, "self.this.append(this)\n",
|
||||||
tab8, "except: self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
tab8, "except:\n", tab8, tab4, "self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4223,12 +4223,11 @@ public:
|
||||||
String *callParms = make_pyParmList(n, true, true, allow_kwargs);
|
String *callParms = make_pyParmList(n, true, true, allow_kwargs);
|
||||||
if (!have_addtofunc(n)) {
|
if (!have_addtofunc(n)) {
|
||||||
if (!fastproxy || olddefs) {
|
if (!fastproxy || olddefs) {
|
||||||
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":", NIL);
|
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||||
Printv(f_shadow, " return ", funcCall(fullname, callParms), "\n", NIL);
|
Printv(f_shadow, tab8, "return ", funcCall(fullname, callParms), "\n", NIL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":", NIL);
|
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||||
Printv(f_shadow, "\n", NIL);
|
|
||||||
if (have_docstring(n))
|
if (have_docstring(n))
|
||||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
|
Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
|
||||||
if (have_pythonprepend(n)) {
|
if (have_pythonprepend(n)) {
|
||||||
|
|
@ -4438,7 +4437,7 @@ public:
|
||||||
} else {
|
} else {
|
||||||
Printv(f_shadow,
|
Printv(f_shadow,
|
||||||
tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n",
|
tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n",
|
||||||
tab8, "try: self.this.append(this)\n", tab8, "except: self.this = this\n", NIL);
|
tab8, "try:\n", tab8, tab4, "self.this.append(this)\n", tab8, "except:\n", tab8, tab4, "self.this = this\n", NIL);
|
||||||
}
|
}
|
||||||
if (have_pythonappend(n))
|
if (have_pythonappend(n))
|
||||||
Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n\n", NIL);
|
Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n\n", NIL);
|
||||||
|
|
@ -4524,7 +4523,7 @@ public:
|
||||||
Printv(f_shadow, tab4, "__swig_destroy__ = ", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "\n", NIL);
|
Printv(f_shadow, tab4, "__swig_destroy__ = ", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "\n", NIL);
|
||||||
if (!have_pythonprepend(n) && !have_pythonappend(n)) {
|
if (!have_pythonprepend(n) && !have_pythonappend(n)) {
|
||||||
if (proxydel) {
|
if (proxydel) {
|
||||||
Printv(f_shadow, tab4, "__del__ = lambda self : None;\n", NIL);
|
Printv(f_shadow, tab4, "__del__ = lambda self: None\n", NIL);
|
||||||
}
|
}
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue