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
141
Merge Requests
141
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
import
compiler.ast
import
compiler.ast
import
compiler.visitor
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')
...
@@ -41,7 +41,7 @@ GIT_ASKPASS = os.path.join(Products.ERP5.product_path, 'bin', 'git_askpass')
class
GitInstallationError
(
EnvironmentError
):
class
GitInstallationError
(
EnvironmentError
):
"""Raised when an installation is broken"""
"""Raised when an installation is broken"""
pass
class
GitError
(
EnvironmentError
):
class
GitError
(
EnvironmentError
):
def
__init__
(
self
,
err
,
out
,
returncode
):
def
__init__
(
self
,
err
,
out
,
returncode
):
...
@@ -240,7 +240,7 @@ class Git(WorkingCopy):
...
@@ -240,7 +240,7 @@ class Git(WorkingCopy):
node_dict
[
parent
]
=
[
path
]
node_dict
[
parent
]
=
[
path
]
path_dict
[
parent
]
=
status
path_dict
[
parent
]
=
status
if
parent
:
if
parent
:
path_list
.
append
(
parent
)
path_list
.
append
(
parent
)
# pylint:disable=modified-iterating-list
else
:
else
:
while
path_dict
.
get
(
parent
,
status
)
!=
status
:
while
path_dict
.
get
(
parent
,
status
)
!=
status
:
path_dict
[
parent
]
=
status
=
'*'
path_dict
[
parent
]
=
status
=
'*'
...
@@ -265,7 +265,7 @@ class Git(WorkingCopy):
...
@@ -265,7 +265,7 @@ class Git(WorkingCopy):
else
:
else
:
child
=
Dir
(
basename
,
dir_status
(
status
))
child
=
Dir
(
basename
,
dir_status
(
status
))
node
.
sub_dirs
.
append
(
child
)
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
return
(
root
.
sub_dirs
or
root
.
sub_files
)
and
root
def
update
(
self
,
keep
=
False
):
def
update
(
self
,
keep
=
False
):
...
@@ -275,7 +275,7 @@ class Git(WorkingCopy):
...
@@ -275,7 +275,7 @@ class Git(WorkingCopy):
if
not
keep
:
if
not
keep
:
self
.
clean
()
self
.
clean
()
self
.
remote_git
(
'pull'
,
'--ff-only'
)
self
.
remote_git
(
'pull'
,
'--ff-only'
)
elif
1
:
# elif local_changes:
elif
1
:
# elif local_changes:
# pylint:disable=using-constant-test
raise
NotImplementedError
raise
NotImplementedError
# addremove
# addremove
# write-tree | commit-tree -> A
# write-tree | commit-tree -> A
...
@@ -363,16 +363,15 @@ class Git(WorkingCopy):
...
@@ -363,16 +363,15 @@ class Git(WorkingCopy):
raise
raise
# try to update our working copy
# try to update our working copy
# TODO: find a solution if there are other local changes
# TODO: find a solution if there are other local changes
# TODO: solve conflicts on */bt/revision automatically
try:
try:
self.git(merge, '
@
{
u
}
', env=env)
self.git(merge, '
@
{
u
}
', env=env)
except GitError as e:
except GitError as e
2
:
# XXX: how to know how it failed ?
# XXX: how to know how it failed ?
try:
try:
self.git(merge, '
--
abort
')
self.git(merge, '
--
abort
')
except GitError:
except GitError:
pass
pass
raise e
raise e
2
# no need to keep a merge commit if push fails again
# no need to keep a merge commit if push fails again
if merge == '
merge
':
if merge == '
merge
':
reset += 1
reset += 1
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.SubversionClient.py
View file @
f2639116
...
@@ -41,6 +41,7 @@ from AccessControl import ClassSecurityInfo
...
@@ -41,6 +41,7 @@ from AccessControl import ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
from
AccessControl.SecurityInfo
import
ModuleSecurityInfo
from
tempfile
import
mkdtemp
from
tempfile
import
mkdtemp
import
shutil
import
shutil
import
six
class
getTransactionalDirectory
(
str
):
class
getTransactionalDirectory
(
str
):
...
@@ -63,17 +64,14 @@ class getTransactionalDirectory(str):
...
@@ -63,17 +64,14 @@ class getTransactionalDirectory(str):
class
SubversionError
(
Exception
):
class
SubversionError
(
Exception
):
"""The base exception class for the Subversion interface.
"""The base exception class for the Subversion interface.
"""
"""
pass
class
SubversionInstallationError
(
SubversionError
):
class
SubversionInstallationError
(
SubversionError
):
"""Raised when an installation is broken.
"""Raised when an installation is broken.
"""
"""
pass
class
SubversionTimeoutError
(
SubversionError
):
class
SubversionTimeoutError
(
SubversionError
):
"""Raised when a Subversion transaction is too long.
"""Raised when a Subversion transaction is too long.
"""
"""
pass
class
SubversionLoginError
(
SubversionError
):
class
SubversionLoginError
(
SubversionError
):
"""Raised when an authentication is required.
"""Raised when an authentication is required.
...
@@ -140,9 +138,9 @@ try:
...
@@ -140,9 +138,9 @@ try:
self
.
client
.
setException
(
SubversionLoginError
(
realm
))
self
.
client
.
setException
(
SubversionLoginError
(
realm
))
return
False
,
''
,
''
,
False
return
False
,
''
,
''
,
False
# BBB. support older versions of pysvn <= 1.6.3
# 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'
)
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'
)
password
=
password
.
encode
(
'utf-8'
)
return
True
,
user
,
password
,
False
return
True
,
user
,
password
,
False
...
@@ -178,7 +176,7 @@ try:
...
@@ -178,7 +176,7 @@ try:
def
__call__
(
self
,
instance
):
def
__call__
(
self
,
instance
):
value
=
getattr
(
instance
.
_obj
,
self
.
_key
)
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'
)
value
=
value
.
encode
(
'utf-8'
)
#elif isinstance(value, pysvn.Entry):
#elif isinstance(value, pysvn.Entry):
elif
str
(
type
(
value
))
==
"<type '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):
...
@@ -154,7 +154,7 @@ class TestTemplateTool(ERP5TypeTestCase):
"""
"""
self
.
_svn_setup_ssl
()
self
.
_svn_setup_ssl
()
# we make this class a global so that it can be pickled
# 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
class
PropertiesTool
(
ActionsTool
):
# pylint:disable=redefined-outer-name
id
=
'portal_properties'
id
=
'portal_properties'
cls
=
PropertiesTool
cls
=
PropertiesTool
...
...
product/ERP5Type/patches/pylint.py
View file @
f2639116
...
@@ -255,6 +255,8 @@ def _getattr(self, name, *args, **kw):
...
@@ -255,6 +255,8 @@ def _getattr(self, name, *args, **kw):
# SOAPPy.Types contains "from SOAPPy.Types import *" which confuses
# SOAPPy.Types contains "from SOAPPy.Types import *" which confuses
# this patch
# this patch
or
self
.
name
==
'SOAPpy.Types'
or
self
.
name
==
'SOAPpy.Types'
# pysvn also confuses pylint
or
self
.
name
==
'pysvn'
):
):
raise
raise
real_module
=
__import__
(
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