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
137
Merge Requests
137
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
d8e9f069
Commit
d8e9f069
authored
Jul 22, 2024
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetic changes and remove unused imports.
parent
0d51382c
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
45 additions
and
41 deletions
+45
-41
bt5/erp5_accounting/DocumentTemplateItem/portal_components/document.erp5.BalanceTransaction.py
...tem/portal_components/document.erp5.BalanceTransaction.py
+1
-1
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_doGetInventory.py
...rp5_accounting_l10n_fr/FiscalReportCell_doGetInventory.py
+1
-1
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_getBalance.py
...ns/erp5_accounting_l10n_fr/FiscalReportCell_getBalance.py
+1
-1
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_getBankAccountBalance.py
...ounting_l10n_fr/FiscalReportCell_getBankAccountBalance.py
+1
-1
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_getThirdPartyBalance.py
...counting_l10n_fr/FiscalReportCell_getThirdPartyBalance.py
+2
-2
bt5/erp5_budget/DocumentTemplateItem/portal_components/document.erp5.CategoryBudgetVariation.py
...ortal_components/document.erp5.CategoryBudgetVariation.py
+1
-1
bt5/erp5_certificate_authority/ToolComponentTemplateItem/portal_components/tool.erp5.CertificateAuthorityTool.py
...m/portal_components/tool.erp5.CertificateAuthorityTool.py
+19
-8
bt5/erp5_configurator/ModuleComponentTemplateItem/portal_components/module.erp5.ConfiguratorTestMixin.py
...em/portal_components/module.erp5.ConfiguratorTestMixin.py
+1
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testNotificationTool.py
...eItem/portal_components/test.erp5.testNotificationTool.py
+1
-1
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
...plateItem/portal_components/test.erp5.testTemplateTool.py
+1
-1
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
...plateItem/portal_components/test.erp5.testHalJsonStyle.py
+1
-1
bt5/erp5_palo/DocumentTemplateItem/portal_components/document.erp5.PALOETLConnection.py
...Item/portal_components/document.erp5.PALOETLConnection.py
+5
-2
bt5/erp5_safeimage/ExtensionTemplateItem/portal_components/extension.erp5.ERP5ZoomifyImage.py
...Item/portal_components/extension.erp5.ERP5ZoomifyImage.py
+0
-1
bt5/erp5_safeimage/SkinTemplateItem/portal_skins/erp5_safeimage/SeleniumSafeImage_uploadFile.py
...rtal_skins/erp5_safeimage/SeleniumSafeImage_uploadFile.py
+0
-8
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingList_fastInput.py
...Item/portal_skins/erp5_trade/SalePackingList_fastInput.py
+0
-1
product/ERP5/tests/utils.py
product/ERP5/tests/utils.py
+2
-1
product/ERP5OOo/tests/TestFormPrintoutMixin.py
product/ERP5OOo/tests/TestFormPrintoutMixin.py
+0
-1
product/ERP5Type/patches/python.py
product/ERP5Type/patches/python.py
+1
-1
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+2
-4
product/PortalTransforms/libtransforms/commandtransform.py
product/PortalTransforms/libtransforms/commandtransform.py
+5
-3
product/Zelenium/scripts/tinyWebServer.py
product/Zelenium/scripts/tinyWebServer.py
+0
-1
No files found.
bt5/erp5_accounting/DocumentTemplateItem/portal_components/document.erp5.BalanceTransaction.py
View file @
d8e9f069
...
@@ -429,7 +429,7 @@ class BalanceTransaction(AccountingTransaction, Inventory):
...
@@ -429,7 +429,7 @@ class BalanceTransaction(AccountingTransaction, Inventory):
return
factory
return
factory
def
_immediateReindexObject
(
self
,
**
kw
):
def
_immediateReindexObject
(
self
,
*
args
,
*
*
kw
):
"""Reindexes the object.
"""Reindexes the object.
This is different indexing that the default Inventory indexing, because
This is different indexing that the default Inventory indexing, because
we want to take into account that lines in this balance transaction to
we want to take into account that lines in this balance transaction to
...
...
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_doGetInventory.py
View file @
d8e9f069
...
@@ -26,7 +26,7 @@ section_region = section.getRegion()
...
@@ -26,7 +26,7 @@ section_region = section.getRegion()
ledger
=
request
.
get
(
"ledger"
,
None
)
ledger
=
request
.
get
(
"ledger"
,
None
)
if
ledger
is
not
None
:
if
ledger
is
not
None
:
portal_categories
=
context
.
getPortalObject
().
portal_categories
portal_categories
=
context
.
getPortalObject
().
portal_categories
if
isinstance
(
ledger
,
list
)
or
isinstance
(
ledger
,
tuple
):
if
isinstance
(
ledger
,
(
tuple
,
list
)
):
ledger_uid
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
ledger_uid
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
else
:
else
:
ledger_uid
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
ledger_uid
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
...
...
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_getBalance.py
View file @
d8e9f069
...
@@ -23,7 +23,7 @@ kw['where_expression'] = " section.portal_type = 'Organisation' "
...
@@ -23,7 +23,7 @@ kw['where_expression'] = " section.portal_type = 'Organisation' "
ledger
=
kw
.
get
(
'ledger'
,
request
.
get
(
"ledger"
,
None
))
ledger
=
kw
.
get
(
'ledger'
,
request
.
get
(
"ledger"
,
None
))
if
ledger
is
not
None
:
if
ledger
is
not
None
:
portal_categories
=
context
.
getPortalObject
().
portal_categories
portal_categories
=
context
.
getPortalObject
().
portal_categories
if
isinstance
(
ledger
,
list
)
or
isinstance
(
ledger
,
tuple
):
if
isinstance
(
ledger
,
(
tuple
,
list
)
):
kw
[
'ledger_uid'
]
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
kw
[
'ledger_uid'
]
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
else
:
else
:
kw
[
'ledger_uid'
]
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
kw
[
'ledger_uid'
]
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
...
...
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_getBankAccountBalance.py
View file @
d8e9f069
...
@@ -22,7 +22,7 @@ kw['where_expression'] = " section.portal_type = 'Organisation' "
...
@@ -22,7 +22,7 @@ kw['where_expression'] = " section.portal_type = 'Organisation' "
ledger
=
kwd
.
get
(
'ledger'
,
request
.
get
(
"ledger"
,
None
))
ledger
=
kwd
.
get
(
'ledger'
,
request
.
get
(
"ledger"
,
None
))
if
ledger
is
not
None
:
if
ledger
is
not
None
:
portal_categories
=
context
.
getPortalObject
().
portal_categories
portal_categories
=
context
.
getPortalObject
().
portal_categories
if
isinstance
(
ledger
,
list
)
or
isinstance
(
ledger
,
tuple
):
if
isinstance
(
ledger
,
(
tuple
,
list
)
):
kw
[
'ledger_uid'
]
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
kw
[
'ledger_uid'
]
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
else
:
else
:
kw
[
'ledger_uid'
]
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
kw
[
'ledger_uid'
]
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
...
...
bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_getThirdPartyBalance.py
View file @
d8e9f069
...
@@ -27,7 +27,7 @@ kw['where_expression'] = " section.portal_type = 'Organisation' "
...
@@ -27,7 +27,7 @@ kw['where_expression'] = " section.portal_type = 'Organisation' "
ledger
=
kwd
.
get
(
'ledger'
,
request
.
get
(
"ledger"
,
None
))
ledger
=
kwd
.
get
(
'ledger'
,
request
.
get
(
"ledger"
,
None
))
if
ledger
is
not
None
:
if
ledger
is
not
None
:
portal_categories
=
context
.
getPortalObject
().
portal_categories
portal_categories
=
context
.
getPortalObject
().
portal_categories
if
isinstance
(
ledger
,
list
)
or
isinstance
(
ledger
,
tuple
):
if
isinstance
(
ledger
,
(
tuple
,
list
)
):
kw
[
'ledger_uid'
]
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
kw
[
'ledger_uid'
]
=
[
portal_categories
.
ledger
.
restrictedTraverse
(
item
).
getUid
()
for
item
in
ledger
]
else
:
else
:
kw
[
'ledger_uid'
]
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
kw
[
'ledger_uid'
]
=
portal_categories
.
ledger
.
restrictedTraverse
(
ledger
).
getUid
()
...
@@ -47,7 +47,7 @@ accounts_to_expand_by_tp = rec_cat.getAccountTypeRelatedValueList(**params) + \
...
@@ -47,7 +47,7 @@ accounts_to_expand_by_tp = rec_cat.getAccountTypeRelatedValueList(**params) + \
total_balance
=
0.0
total_balance
=
0.0
for
account_gap_number
in
accounts
:
for
account_gap_number
in
accounts
:
# We get all acounts strict member of this GAP category
# We get all ac
c
ounts strict member of this GAP category
gap
=
context
.
restrictedTraverse
(
'portal_categories/'
+
getURL
(
account_gap_number
))
gap
=
context
.
restrictedTraverse
(
'portal_categories/'
+
getURL
(
account_gap_number
))
for
account
in
gap
.
getGapRelatedValueList
(
portal_type
=
'Account'
):
for
account
in
gap
.
getGapRelatedValueList
(
portal_type
=
'Account'
):
...
...
bt5/erp5_budget/DocumentTemplateItem/portal_components/document.erp5.CategoryBudgetVariation.py
View file @
d8e9f069
...
@@ -207,7 +207,7 @@ class CategoryBudgetVariation(BudgetVariation):
...
@@ -207,7 +207,7 @@ class CategoryBudgetVariation(BudgetVariation):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBudgetVariationRangeCategoryList'
)
'getBudgetVariationRangeCategoryList'
)
def
getBudgetVariationRangeCategoryList
(
self
,
context
):
def
getBudgetVariationRangeCategoryList
(
self
,
_
):
"""Returns the Variation Range Category List that can be applied to this
"""Returns the Variation Range Category List that can be applied to this
budget.
budget.
"""
"""
...
...
bt5/erp5_certificate_authority/ToolComponentTemplateItem/portal_components/tool.erp5.CertificateAuthorityTool.py
View file @
d8e9f069
...
@@ -101,7 +101,8 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -101,7 +101,8 @@ class CertificateAuthorityTool(BaseTool):
Raises CertificateAuthorityBusy"""
Raises CertificateAuthorityBusy"""
if
os
.
path
.
exists
(
self
.
lock
):
if
os
.
path
.
exists
(
self
.
lock
):
raise
CertificateAuthorityBusy
raise
CertificateAuthorityBusy
open
(
self
.
lock
,
'w'
).
write
(
'locked'
)
with
open
(
self
.
lock
,
'w'
)
as
f
:
f
.
write
(
'locked'
)
def
_unlockCertificateAuthority
(
self
):
def
_unlockCertificateAuthority
(
self
):
"""Checks lock and locks Certificate Authority tool"""
"""Checks lock and locks Certificate Authority tool"""
...
@@ -190,7 +191,8 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -190,7 +191,8 @@ class CertificateAuthorityTool(BaseTool):
self
.
_checkCertificateAuthority
()
self
.
_checkCertificateAuthority
()
self
.
_lockCertificateAuthority
()
self
.
_lockCertificateAuthority
()
index
=
open
(
self
.
index
).
read
().
splitlines
()
with
open
(
self
.
index
)
as
f
:
index
=
f
.
read
().
splitlines
()
valid_line_list
=
[
q
for
q
in
index
if
q
.
startswith
(
'V'
)
and
valid_line_list
=
[
q
for
q
in
index
if
q
.
startswith
(
'V'
)
and
(
'CN=%s/'
%
common_name
in
q
)]
(
'CN=%s/'
%
common_name
in
q
)]
if
len
(
valid_line_list
)
>=
1
:
if
len
(
valid_line_list
)
>=
1
:
...
@@ -199,7 +201,8 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -199,7 +201,8 @@ class CertificateAuthorityTool(BaseTool):
'please revoke it before request a new one..'
%
common_name
)
'please revoke it before request a new one..'
%
common_name
)
try
:
try
:
new_id
=
open
(
self
.
serial
,
'r'
).
read
().
strip
().
lower
()
with
open
(
self
.
serial
,
'r'
)
as
f
:
new_id
=
f
.
read
().
strip
().
lower
()
key
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'private'
,
key
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'private'
,
new_id
+
'.key'
)
new_id
+
'.key'
)
csr
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
new_id
+
'.csr'
)
csr
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
new_id
+
'.csr'
)
...
@@ -214,9 +217,13 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -214,9 +217,13 @@ class CertificateAuthorityTool(BaseTool):
'-batch'
,
'-config'
,
self
.
openssl_config
,
'-out'
,
cert
,
'-infiles'
,
'-batch'
,
'-config'
,
self
.
openssl_config
,
'-out'
,
cert
,
'-infiles'
,
csr
])
csr
])
os
.
unlink
(
csr
)
os
.
unlink
(
csr
)
with
open
(
key
)
as
f
:
key
=
f
.
read
()
with
open
(
cert
)
as
f
:
cert
=
f
.
read
()
return
dict
(
return
dict
(
key
=
open
(
key
).
read
()
,
key
=
key
,
certificate
=
open
(
cert
).
read
()
,
certificate
=
cert
,
id
=
new_id
,
id
=
new_id
,
common_name
=
common_name
)
common_name
=
common_name
)
except
Exception
:
except
Exception
:
...
@@ -240,7 +247,8 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -240,7 +247,8 @@ class CertificateAuthorityTool(BaseTool):
self
.
_checkCertificateAuthority
()
self
.
_checkCertificateAuthority
()
self
.
_lockCertificateAuthority
()
self
.
_lockCertificateAuthority
()
try
:
try
:
new_id
=
open
(
self
.
crl
,
'r'
).
read
().
strip
().
lower
()
with
open
(
self
.
crl
,
'r'
)
as
f
:
new_id
=
f
.
read
().
strip
().
lower
()
crl_path
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'crl'
)
crl_path
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'crl'
)
crl
=
os
.
path
.
join
(
crl_path
,
new_id
+
'.crl'
)
crl
=
os
.
path
.
join
(
crl_path
,
new_id
+
'.crl'
)
cert
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'certs'
,
cert
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'certs'
,
...
@@ -258,7 +266,9 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -258,7 +266,9 @@ class CertificateAuthorityTool(BaseTool):
alias
+=
str
(
len
(
glob
.
glob
(
alias
+
'*'
)))
alias
+=
str
(
len
(
glob
.
glob
(
alias
+
'*'
)))
created
.
append
(
alias
)
created
.
append
(
alias
)
os
.
symlink
(
os
.
path
.
basename
(
crl
),
alias
)
os
.
symlink
(
os
.
path
.
basename
(
crl
),
alias
)
return
dict
(
crl
=
open
(
crl
).
read
())
with
open
(
crl
)
as
f
:
crl
=
f
.
read
()
return
dict
(
crl
=
crl
)
except
Exception
:
except
Exception
:
e
=
sys
.
exc_info
()
e
=
sys
.
exc_info
()
try
:
try
:
...
@@ -276,7 +286,8 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -276,7 +286,8 @@ class CertificateAuthorityTool(BaseTool):
self
.
_unlockCertificateAuthority
()
self
.
_unlockCertificateAuthority
()
def
_getValidSerial
(
self
,
common_name
):
def
_getValidSerial
(
self
,
common_name
):
index
=
open
(
self
.
index
).
read
().
splitlines
()
with
open
(
self
.
index
)
as
f
:
index
=
f
.
read
().
splitlines
()
valid_line_list
=
[
q
for
q
in
index
if
q
.
startswith
(
'V'
)
and
valid_line_list
=
[
q
for
q
in
index
if
q
.
startswith
(
'V'
)
and
(
'CN=%s/'
%
common_name
in
q
)]
(
'CN=%s/'
%
common_name
in
q
)]
if
len
(
valid_line_list
)
<
1
:
if
len
(
valid_line_list
)
<
1
:
...
...
bt5/erp5_configurator/ModuleComponentTemplateItem/portal_components/module.erp5.ConfiguratorTestMixin.py
View file @
d8e9f069
##############################################################################
##############################################################################
# coding: utf-8
# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
# Rafael Monnerat <rafael@nexedi.com>
# Rafael Monnerat <rafael@nexedi.com>
# Ivan Tyagov <ivan@nexedi.com>
# Ivan Tyagov <ivan@nexedi.com>
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testNotificationTool.py
View file @
d8e9f069
...
@@ -37,7 +37,7 @@ import email
...
@@ -37,7 +37,7 @@ import email
from
email.header
import
decode_header
,
make_header
from
email.header
import
decode_header
,
make_header
from
email.utils
import
parseaddr
from
email.utils
import
parseaddr
# Copied from
ERP5Type/patches/CMFMailI
n.py
# Copied from
bt5/erp5_egov/TestTemplateItem/testEGovMixi
n.py
def
decode_email
(
file_
):
def
decode_email
(
file_
):
# Prepare result
# Prepare result
theMail
=
{
theMail
=
{
...
...
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
View file @
d8e9f069
...
@@ -865,7 +865,7 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -865,7 +865,7 @@ class TestTemplateTool(ERP5TypeTestCase):
erp5_test
=
self
.
portal
.
portal_skins
[
'erp5_test'
]
erp5_test
=
self
.
portal
.
portal_skins
[
'erp5_test'
]
self
.
assertTrue
(
erp5_test
.
hasObject
(
'test_file'
))
self
.
assertTrue
(
erp5_test
.
hasObject
(
'test_file'
))
def
test_owner
hs
ip
(
self
):
def
test_owner
sh
ip
(
self
):
self
.
assertEqual
(
self
.
assertEqual
(
self
.
portal
.
portal_skins
.
erp5_core
.
getOwnerTuple
(),
self
.
portal
.
portal_skins
.
erp5_core
.
getOwnerTuple
(),
([
self
.
portal
.
getId
(),
'acl_users'
],
'System Processes'
),
([
self
.
portal
.
getId
(),
'acl_users'
],
'System Processes'
),
...
...
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
View file @
d8e9f069
...
@@ -1725,7 +1725,7 @@ return context.getPortalObject().foo_module.contentValues()
...
@@ -1725,7 +1725,7 @@ return context.getPortalObject().foo_module.contentValues()
form_relative_url='
portal_skins
/
erp5_ui_test
/
FooModule_viewFooList
/
listbox
'
form_relative_url='
portal_skins
/
erp5_ui_test
/
FooModule_viewFooList
/
listbox
'
)
)
result_dict = json.loads(result)
result_dict = json.loads(result)
#
edital
ble creation date is defined at proxy form
#
edita
ble creation date is defined at proxy form
# Test the listbox_uid parameter
# Test the listbox_uid parameter
self.assertEqual(result_dict['
_embedded
']['
contents
'][0]['
listbox_uid
:
list
']['
key
'], '
listbox_uid
:
list
')
self.assertEqual(result_dict['
_embedded
']['
contents
'][0]['
listbox_uid
:
list
']['
key
'], '
listbox_uid
:
list
')
self.assertEqual(result_dict['
_embedded
']['
contents
'][0]['
id
']['
field_gadget_param
']['
type
'], '
StringField
')
self.assertEqual(result_dict['
_embedded
']['
contents
'][0]['
id
']['
field_gadget_param
']['
type
'], '
StringField
')
...
...
bt5/erp5_palo/DocumentTemplateItem/portal_components/document.erp5.PALOETLConnection.py
View file @
d8e9f069
...
@@ -69,13 +69,16 @@ class PALOETLConnection(XMLObject):
...
@@ -69,13 +69,16 @@ class PALOETLConnection(XMLObject):
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
_ignore_ssl_certificate_check
=
True
_fix_service_location
=
True
def
_getSudsClient
(
self
):
def
_getSudsClient
(
self
):
# maybe client can be cached as a _v_ attribute. For now, we do not care about performance.
# maybe client can be cached as a _v_ attribute. For now, we do not care about performance.
if
"ignore ssl certificate check"
:
if
self
.
_ignore_ssl_certificate_check
:
client
=
suds
.
client
.
Client
(
self
.
getUrlString
(),
transport
=
HTTPAuthenticatedUnverifiedSSL
())
client
=
suds
.
client
.
Client
(
self
.
getUrlString
(),
transport
=
HTTPAuthenticatedUnverifiedSSL
())
else
:
else
:
client
=
suds
.
client
.
Client
(
self
.
getUrlString
())
client
=
suds
.
client
.
Client
(
self
.
getUrlString
())
if
"fix service location"
:
if
self
.
_fix_service_location
:
# XXX The axis2 generated webservice only supports http on port 8080.
# XXX The axis2 generated webservice only supports http on port 8080.
# It seems to be using an old and buggy version of axis2.
# It seems to be using an old and buggy version of axis2.
# Easiest workaround is to force the port (in WSDL terminology) location.
# Easiest workaround is to force the port (in WSDL terminology) location.
...
...
bt5/erp5_safeimage/ExtensionTemplateItem/portal_components/extension.erp5.ERP5ZoomifyImage.py
View file @
d8e9f069
...
@@ -28,7 +28,6 @@ try:
...
@@ -28,7 +28,6 @@ try:
except
ImportError
:
# BBB Zope2
except
ImportError
:
# BBB Zope2
from
Globals
import
package_home
from
Globals
import
package_home
import
PIL.Image
as
PIL_Image
import
PIL.Image
as
PIL_Image
import
thread
import
random
import
random
import
base64
import
base64
from
OFS.Folder
import
Folder
from
OFS.Folder
import
Folder
...
...
bt5/erp5_safeimage/SkinTemplateItem/portal_skins/erp5_safeimage/SeleniumSafeImage_uploadFile.py
View file @
d8e9f069
#from Products.ERP5.Document.TileImageTransformed import TileImageTransformed
#from cStringIO import StringIO
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
data
=
portal
.
restrictedTraverse
(
"portal_skins/erp5_safeimage/img/image_test.jpg"
)
data
=
portal
.
restrictedTraverse
(
"portal_skins/erp5_safeimage/img/image_test.jpg"
)
print
(
data
.
data
)
print
(
data
.
data
)
return
printed
return
printed
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingList_fastInput.py
View file @
d8e9f069
...
@@ -70,7 +70,6 @@ with ImmediateReindexContextManager() as immediate_reindex_context_manager:
...
@@ -70,7 +70,6 @@ with ImmediateReindexContextManager() as immediate_reindex_context_manager:
line_variation_base_category_list
=
line_variation_base_category_dict
.
keys
()
line_variation_base_category_list
=
line_variation_base_category_dict
.
keys
()
# construct new content (container_line)
# construct new content (container_line)
resource_url
=
resource_url
new_container_line_id
=
str
(
container
.
generateNewId
())
new_container_line_id
=
str
(
container
.
generateNewId
())
container_line
=
container
.
newContent
(
container_line
=
container
.
newContent
(
immediate_reindex
=
immediate_reindex_context_manager
,
immediate_reindex
=
immediate_reindex_context_manager
,
...
...
product/ERP5/tests/utils.py
View file @
d8e9f069
...
@@ -186,4 +186,5 @@ class BusinessTemplateInfoDir(BusinessTemplateInfoBase):
...
@@ -186,4 +186,5 @@ class BusinessTemplateInfoDir(BusinessTemplateInfoBase):
return
fileinfo
return
fileinfo
def
readFileInfo
(
self
,
fileinfo
):
def
readFileInfo
(
self
,
fileinfo
):
return
open
(
fileinfo
).
read
()
with
open
(
fileinfo
)
as
f
:
return
f
.
read
()
product/ERP5OOo/tests/TestFormPrintoutMixin.py
View file @
d8e9f069
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
from
six
import
StringIO
class
TestFormPrintoutMixin
(
ERP5TypeTestCase
):
class
TestFormPrintoutMixin
(
ERP5TypeTestCase
):
run_all_test
=
1
run_all_test
=
1
...
...
product/ERP5Type/patches/python.py
View file @
d8e9f069
...
@@ -130,7 +130,7 @@ def patch_linecache():
...
@@ -130,7 +130,7 @@ def patch_linecache():
properly without requiring to create a temporary file on the filesystem
properly without requiring to create a temporary file on the filesystem
The filename is is always '<portal_components/*>' for ZODB Components,
The filename is is always '<portal_components/*>' for ZODB Components,
'(FILENAME)?Script
\
(Py
t
hon
\
)
'
for Zope Python Scripts and 'Python
'(FILENAME)?Script
\
\
(Python
\
\
)' for Zope Python Scripts and 'Python
Expression "CODE"' for TALES expressions.
Expression "CODE"' for TALES expressions.
linecache.cache filled by linecache.updatecache() called by the original
linecache.cache filled by linecache.updatecache() called by the original
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
d8e9f069
...
@@ -9,7 +9,6 @@ __version__ = '0.3.0'
...
@@ -9,7 +9,6 @@ __version__ = '0.3.0'
import
base64
import
base64
import
errno
import
errno
import
httplib
import
os
import
os
import
random
import
random
import
re
import
re
...
@@ -18,7 +17,6 @@ import string
...
@@ -18,7 +17,6 @@ import string
import
sys
import
sys
import
time
import
time
import
traceback
import
traceback
import
urllib
from
six.moves
import
configparser
from
six.moves
import
configparser
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
from
io
import
BytesIO
from
io
import
BytesIO
...
@@ -32,7 +30,6 @@ from DateTime import DateTime
...
@@ -32,7 +30,6 @@ from DateTime import DateTime
import
mock
import
mock
import
Products.ZMySQLDA.DA
import
Products.ZMySQLDA.DA
from
Products.ZMySQLDA.DA
import
Connection
as
ZMySQLDA_Connection
from
Products.ZMySQLDA.DA
import
Connection
as
ZMySQLDA_Connection
from
zope.globalrequest
import
clearRequest
from
zope.globalrequest
import
getRequest
from
zope.globalrequest
import
getRequest
from
zope.globalrequest
import
setRequest
from
zope.globalrequest
import
setRequest
import
six
import
six
...
@@ -171,7 +168,8 @@ def _createTestPromiseConfigurationFile(promise_path, bt5_repository_path_list=N
...
@@ -171,7 +168,8 @@ def _createTestPromiseConfigurationFile(promise_path, bt5_repository_path_list=N
promise_config
.
set
(
'portal_certificate_authority'
,
'certificate_authority_path'
,
promise_config
.
set
(
'portal_certificate_authority'
,
'certificate_authority_path'
,
os
.
environ
[
'TEST_CA_PATH'
])
os
.
environ
[
'TEST_CA_PATH'
])
promise_config
.
write
(
open
(
promise_path
,
'w'
))
with
open
(
promise_path
,
'w'
)
as
f
:
promise_config
.
write
(
f
)
def
profile_if_environ
(
environment_var_name
):
def
profile_if_environ
(
environment_var_name
):
if
int
(
os
.
environ
.
get
(
environment_var_name
,
0
)):
if
int
(
os
.
environ
.
get
(
environment_var_name
,
0
)):
...
...
product/PortalTransforms/libtransforms/commandtransform.py
View file @
d8e9f069
...
@@ -34,7 +34,8 @@ class commandtransform:
...
@@ -34,7 +34,8 @@ class commandtransform:
os
.
mkdir
(
tmpdir
)
os
.
mkdir
(
tmpdir
)
filename
=
kwargs
.
get
(
"filename"
,
''
)
filename
=
kwargs
.
get
(
"filename"
,
''
)
fullname
=
join
(
tmpdir
,
basename
(
filename
))
fullname
=
join
(
tmpdir
,
basename
(
filename
))
filedest
=
open
(
fullname
,
"wb"
).
write
(
data
)
with
open
(
fullname
,
"wb"
)
as
f
:
f
.
write
(
data
)
return
tmpdir
,
fullname
return
tmpdir
,
fullname
def
subObjects
(
self
,
tmpdir
):
def
subObjects
(
self
,
tmpdir
):
...
@@ -50,7 +51,8 @@ class commandtransform:
...
@@ -50,7 +51,8 @@ class commandtransform:
def
fixImages
(
self
,
path
,
images
,
objects
):
def
fixImages
(
self
,
path
,
images
,
objects
):
for
image
in
images
:
for
image
in
images
:
objects
[
image
]
=
open
(
join
(
path
,
image
),
'rb'
).
read
()
with
open
(
join
(
path
,
image
),
'rb'
)
as
f
:
objects
[
image
]
=
f
.
read
()
def
cleanDir
(
self
,
tmpdir
):
def
cleanDir
(
self
,
tmpdir
):
shutil
.
rmtree
(
tmpdir
)
shutil
.
rmtree
(
tmpdir
)
...
@@ -151,7 +153,7 @@ class subprocesstransform:
...
@@ -151,7 +153,7 @@ class subprocesstransform:
try
:
try
:
if
not
self
.
useStdin
:
if
not
self
.
useStdin
:
stdin_file
=
tempfile
.
NamedTemporaryFile
()
stdin_file
=
tempfile
.
NamedTemporaryFile
()
stdin_file
.
write
(
data
)
stdin_file
.
write
(
data
)
stdin_file
.
seek
(
0
)
stdin_file
.
seek
(
0
)
command
=
command
%
{
'infile'
:
stdin_file
.
name
}
# apply tmp name to command
command
=
command
%
{
'infile'
:
stdin_file
.
name
}
# apply tmp name to command
data
=
None
data
=
None
...
...
product/Zelenium/scripts/tinyWebServer.py
View file @
d8e9f069
...
@@ -21,7 +21,6 @@ from __future__ import print_function
...
@@ -21,7 +21,6 @@ from __future__ import print_function
import
six.moves.BaseHTTPServer
import
six.moves.BaseHTTPServer
import
six.moves.CGIHTTPServer
import
six.moves.CGIHTTPServer
import
time
import
time
import
httplib
import
sys
import
sys
PORT
=
8000
PORT
=
8000
...
...
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