Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
f2639116
Commit
f2639116
authored
Apr 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forge: pylint py3
parent
aad4288c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
14 deletions
+16
-14
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.PythonScriptParserUtility.py
...al_components/extension.erp5.PythonScriptParserUtility.py
+3
-0
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Git.py
...omponentTemplateItem/portal_components/module.erp5.Git.py
+6
-7
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.py
...ateItem/portal_components/module.erp5.SubversionClient.py
+4
-6
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
...plateItem/portal_components/test.erp5.testTemplateTool.py
+1
-1
product/ERP5Type/patches/pylint.py
product/ERP5Type/patches/pylint.py
+2
-0
No files found.
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.PythonScriptParserUtility.py
View file @
f2639116
# TODO: this module was not ported to python3, it's not clear if this
# is still useful
# pylint:disable=import-error
import
compiler
import
compiler.ast
import
compiler.visitor
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Git.py
View file @
f2639116
...
...
@@ -41,7 +41,7 @@ GIT_ASKPASS = os.path.join(Products.ERP5.product_path, 'bin', 'git_askpass')
class
GitInstallationError
(
EnvironmentError
):
"""Raised when an installation is broken"""
pass
class
GitError
(
EnvironmentError
):
def
__init__
(
self
,
err
,
out
,
returncode
):
...
...
@@ -240,7 +240,7 @@ class Git(WorkingCopy):
node_dict
[
parent
]
=
[
path
]
path_dict
[
parent
]
=
status
if
parent
:
path_list
.
append
(
parent
)
path_list
.
append
(
parent
)
# pylint:disable=modified-iterating-list
else
:
while
path_dict
.
get
(
parent
,
status
)
!=
status
:
path_dict
[
parent
]
=
status
=
'*'
...
...
@@ -265,7 +265,7 @@ class Git(WorkingCopy):
else
:
child
=
Dir
(
basename
,
dir_status
(
status
))
node
.
sub_dirs
.
append
(
child
)
path_list
.
append
((
content
,
child
))
path_list
.
append
((
content
,
child
))
# pylint:disable=modified-iterating-list
return
(
root
.
sub_dirs
or
root
.
sub_files
)
and
root
def
update
(
self
,
keep
=
False
):
...
...
@@ -275,7 +275,7 @@ class Git(WorkingCopy):
if
not
keep
:
self
.
clean
()
self
.
remote_git
(
'pull'
,
'--ff-only'
)
elif
1
:
# elif local_changes:
elif
1
:
# elif local_changes:
# pylint:disable=using-constant-test
raise
NotImplementedError
# addremove
# write-tree | commit-tree -> A
...
...
@@ -363,16 +363,15 @@ class Git(WorkingCopy):
raise
# try to update our working copy
# TODO: find a solution if there are other local changes
# TODO: solve conflicts on */bt/revision automatically
try:
self.git(merge, '
@
{
u
}
', env=env)
except GitError as e:
except GitError as e
2
:
# XXX: how to know how it failed ?
try:
self.git(merge, '
--
abort
')
except GitError:
pass
raise e
raise e
2
# no need to keep a merge commit if push fails again
if merge == '
merge
':
reset += 1
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.py
View file @
f2639116
...
...
@@ -41,6 +41,7 @@ from AccessControl import ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
from
tempfile
import
mkdtemp
import
shutil
import
six
class
getTransactionalDirectory
(
str
):
...
...
@@ -63,17 +64,14 @@ class getTransactionalDirectory(str):
class
SubversionError
(
Exception
):
"""The base exception class for the Subversion interface.
"""
pass
class
SubversionInstallationError
(
SubversionError
):
"""Raised when an installation is broken.
"""
pass
class
SubversionTimeoutError
(
SubversionError
):
"""Raised when a Subversion transaction is too long.
"""
pass
class
SubversionLoginError
(
SubversionError
):
"""Raised when an authentication is required.
...
...
@@ -140,9 +138,9 @@ try:
self
.
client
.
setException
(
SubversionLoginError
(
realm
))
return
False
,
''
,
''
,
False
# BBB. support older versions of pysvn <= 1.6.3
if
isinstance
(
user
,
unicod
e
):
if
six
.
PY2
and
isinstance
(
user
,
six
.
text_typ
e
):
user
=
user
.
encode
(
'utf-8'
)
if
isinstance
(
password
,
unicod
e
):
if
six
.
PY2
and
isinstance
(
password
,
six
.
text_typ
e
):
password
=
password
.
encode
(
'utf-8'
)
return
True
,
user
,
password
,
False
...
...
@@ -178,7 +176,7 @@ try:
def
__call__
(
self
,
instance
):
value
=
getattr
(
instance
.
_obj
,
self
.
_key
)
if
isinstance
(
value
,
unicod
e
):
if
six
.
PY2
and
isinstance
(
value
,
six
.
text_typ
e
):
value
=
value
.
encode
(
'utf-8'
)
#elif isinstance(value, pysvn.Entry):
elif
str
(
type
(
value
))
==
"<type 'entry'>"
:
...
...
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
View file @
f2639116
...
...
@@ -154,7 +154,7 @@ class TestTemplateTool(ERP5TypeTestCase):
"""
self
.
_svn_setup_ssl
()
# we make this class a global so that it can be pickled
global
PropertiesTool
# pylint:disable=global-variable-not-assigned
global
PropertiesTool
# pylint:disable=global-variable-not-assigned
,global-variable-undefined
class
PropertiesTool
(
ActionsTool
):
# pylint:disable=redefined-outer-name
id
=
'portal_properties'
cls
=
PropertiesTool
...
...
product/ERP5Type/patches/pylint.py
View file @
f2639116
...
...
@@ -255,6 +255,8 @@ def _getattr(self, name, *args, **kw):
# SOAPPy.Types contains "from SOAPPy.Types import *" which confuses
# this patch
or
self
.
name
==
'SOAPpy.Types'
# pysvn also confuses pylint
or
self
.
name
==
'pysvn'
):
raise
real_module
=
__import__
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment