Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
9d339516
Commit
9d339516
authored
Aug 05, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Make Pylint Happy
parent
a0509207
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
20 additions
and
26 deletions
+20
-26
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/HostingSubscription_calculateSubscriptionStartDate.py
...ing/HostingSubscription_calculateSubscriptionStartDate.py
+1
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/HostingSubscription_calculateSubscriptionStopDate.py
...ting/HostingSubscription_calculateSubscriptionStopDate.py
+1
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_storeOpenSaleOrderJournal.py
...ins/slapos_accounting/Person_storeOpenSaleOrderJournal.py
+1
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/Computer_getLatestCPUPercentLoad.py
...ns/slapos_consumption/Computer_getLatestCPUPercentLoad.py
+1
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/Computer_getWattConsumption.py
...l_skins/slapos_consumption/Computer_getWattConsumption.py
+7
-6
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/Computer_getZeroEmissionRatio.py
...skins/slapos_consumption/Computer_getZeroEmissionRatio.py
+1
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/HostingSubscription_getMostEcoEfficientSoftwareInstance.py
...ostingSubscription_getMostEcoEfficientSoftwareInstance.py
+0
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/HostingSubscription_getResourceConsumptionDetailList.py
...n/HostingSubscription_getResourceConsumptionDetailList.py
+2
-3
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/HostingSubscription_getStatForResource.py
...pos_consumption/HostingSubscription_getStatForResource.py
+0
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/SoftwareInstance_getCurrentDeltaCO2.py
...slapos_consumption/SoftwareInstance_getCurrentDeltaCO2.py
+1
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/SoftwareInstance_getFutureDeltaCO2.py
.../slapos_consumption/SoftwareInstance_getFutureDeltaCO2.py
+1
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_simulation/SlapOSInvoiceTransaction_selectDelivery.py
...pos_simulation/SlapOSInvoiceTransaction_selectDelivery.py
+1
-1
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
.../portal_components/test.erp5.testSlapOSAccountingSkins.py
+1
-1
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.xml
...portal_components/test.erp5.testSlapOSAccountingSkins.xml
+1
-3
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSConsumptionSkins.py
...portal_components/test.erp5.testSlapOSConsumptionSkins.py
+0
-3
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSConsumptionSkins.xml
...ortal_components/test.erp5.testSlapOSConsumptionSkins.xml
+1
-4
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/HostingSubscription_calculateSubscriptionStartDate.py
View file @
9d339516
...
...
@@ -2,7 +2,7 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
from
erp5.component.module.DateUtils
import
addToDate
,
getClosestDate
from
erp5.component.module.DateUtils
import
getClosestDate
hosting_subscription
=
context
portal
=
context
.
getPortalObject
()
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/HostingSubscription_calculateSubscriptionStopDate.py
View file @
9d339516
...
...
@@ -7,7 +7,7 @@ from erp5.component.module.DateUtils import addToDate, getClosestDate
hosting_subscription
=
context
portal
=
context
.
getPortalObject
()
start_date
=
context
.
HostingSubscription_calculateSubscriptionStartDate
()
#
start_date = context.HostingSubscription_calculateSubscriptionStartDate()
workflow_item_list
=
portal
.
portal_workflow
.
getInfoFor
(
ob
=
hosting_subscription
,
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_storeOpenSaleOrderJournal.py
View file @
9d339516
from
erp5.component.module.DateUtils
import
addToDate
,
getClosestDate
from
erp5.component.module.DateUtils
import
addToDate
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/Computer_getLatestCPUPercentLoad.py
View file @
9d339516
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
(
"Unauthorized call script from URL"
)
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/Computer_getWattConsumption.py
View file @
9d339516
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
(
"Unauthorized call script from URL"
)
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/Computer_getZeroEmissionRatio.py
View file @
9d339516
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
(
"Unauthorized call script from URL"
)
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/HostingSubscription_getMostEcoEfficientSoftwareInstance.py
View file @
9d339516
partition_co2_dict
=
{}
min_delta_co2
=
2000
minimal_candidate
=
None
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/HostingSubscription_getResourceConsumptionDetailList.py
View file @
9d339516
from
DateTime
import
DateTime
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
Products.ERP5Type.Document
import
newTempDocument
from
Products.ERP5Type.Document
import
newTempBase
portal
=
context
.
getPortalObject
()
...
...
@@ -136,7 +135,7 @@ for date in sorted(consumption_dict, reverse=True):
hosting_title
,
instance_dict
,
hs_url
=
consumption_dict
[
date
][
hosting_key
]
for
instance_value_list
in
instance_dict
.
values
():
instance_title
,
values
,
instance_url
,
computer_title
=
instance_value_list
line
=
newTemp
Document
(
portal
,
instance_url
,
uid
=
"%s_%s"
%
(
context
.
getUid
(),
i
))
line
=
newTemp
Base
(
portal
,
instance_url
,
uid
=
"%s_%s"
%
(
context
.
getUid
(),
i
))
line
.
edit
(
title
=
hosting_title
,
start_date
=
date
,
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/HostingSubscription_getStatForResource.py
View file @
9d339516
from
Products.ZSQLCatalog.SQLCatalog
import
Query
portal
=
context
.
getPortalObject
()
query_kw
.
update
(
query_kw
[
'selection'
].
getParams
())
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/SoftwareInstance_getCurrentDeltaCO2.py
View file @
9d339516
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/SoftwareInstance_getFutureDeltaCO2.py
View file @
9d339516
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_simulation/SlapOSInvoiceTransaction_selectDelivery.py
View file @
9d339516
...
...
@@ -32,4 +32,4 @@ for movement in movement_list:
if
line
is
not
None
:
deliveries_keys
[
line
.
getExplanationValue
()]
=
1
return
filter
(
lambda
x
:
x
is
not
None
,
deliveries_keys
.
keys
())
return
[
x
for
x
in
deliveries_keys
if
x
is
not
None
]
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
View file @
9d339516
...
...
@@ -170,7 +170,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
def
test_OpenSaleOrder_reindexIfIndexedBeforeLine_line_indexed_before
(
self
):
portal
=
self
.
portal
order
=
self
.
createOpenSaleOrder
()
line
=
order
.
newContent
(
portal_type
=
"Open Sale Order Line"
)
order
.
newContent
(
portal_type
=
"Open Sale Order Line"
)
self
.
tic
()
order
.
activate
().
immediateReindexObject
()
# XXX One more kitten killed
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.xml
View file @
9d339516
...
...
@@ -45,9 +45,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:173, 4: Unused variable \'line\' (unused-variable)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSConsumptionSkins.py
View file @
9d339516
...
...
@@ -5,7 +5,6 @@
#
##############################################################################
import
transaction
from
erp5.component.test.SlapOSTestCaseMixin
import
\
SlapOSTestCaseMixinWithAbort
,
SlapOSTestCaseMixin
,
simulate
from
zExceptions
import
Unauthorized
...
...
@@ -267,7 +266,6 @@ class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration(
def
createAllocatedComputer
(
self
):
# Create person
password
=
self
.
generateNewId
()
reference
=
'test_%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
reference
,
...
...
@@ -275,7 +273,6 @@ class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration(
person
.
newContent
(
portal_type
=
'Assignment'
,
role
=
'member'
).
open
()
# Create second person
password
=
self
.
generateNewId
()
reference
=
'test_%s'
%
self
.
generateNewId
()
second_person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
reference
,
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSConsumptionSkins.xml
View file @
9d339516
...
...
@@ -45,10 +45,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:270, 4: Unused variable \'password\' (unused-variable)
</string>
<string>
W: 8, 0: Unused import transaction (unused-import)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
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