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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laurent S
erp5
Commits
7e76a151
Commit
7e76a151
authored
May 07, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: remove tabs in product/*.py
parent
d452eb6e
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
158 additions
and
159 deletions
+158
-159
product/ERP5/Document/AttributeUnicityConstraint.py
product/ERP5/Document/AttributeUnicityConstraint.py
+1
-1
product/ERP5/Document/CategoryRelatedMembershipStateConstraint.py
...ERP5/Document/CategoryRelatedMembershipStateConstraint.py
+1
-1
product/ERP5/Extensions/Inspect.py
product/ERP5/Extensions/Inspect.py
+1
-1
product/ERP5/TargetSolver/CopyToTarget.py
product/ERP5/TargetSolver/CopyToTarget.py
+1
-1
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+2
-2
product/ERP5/tests/erp5_url_checker.py
product/ERP5/tests/erp5_url_checker.py
+2
-2
product/ERP5/tests/testBug.py
product/ERP5/tests/testBug.py
+7
-7
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+22
-22
product/ERP5/tests/testERP5eGov.py
product/ERP5/tests/testERP5eGov.py
+3
-4
product/ERP5/tests/testItem.py
product/ERP5/tests/testItem.py
+1
-1
product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py
...ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py
+11
-11
product/ERP5Banking/tests/testERP5BankingCashExchange.py
product/ERP5Banking/tests/testERP5BankingCashExchange.py
+10
-10
product/ERP5Banking/tests/testERP5BankingForeignCashReception.py
.../ERP5Banking/tests/testERP5BankingForeignCashReception.py
+2
-2
product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py
...t/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py
+7
-7
product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py
product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py
+1
-1
product/ERP5Form/Tool/SelectionTool.py
product/ERP5Form/Tool/SelectionTool.py
+3
-3
product/ERP5Legacy/tests/testLegacyConversionInSimulation.py
product/ERP5Legacy/tests/testLegacyConversionInSimulation.py
+47
-47
product/ERP5Type/DocumentationHelper/DCWorkflowTransitionDocumentationHelper.py
...entationHelper/DCWorkflowTransitionDocumentationHelper.py
+1
-1
product/ERP5Type/tests/testSessionTool.py
product/ERP5Type/tests/testSessionTool.py
+2
-2
product/Formulator/Validator.py
product/Formulator/Validator.py
+1
-1
product/TimerService/timerserver/timerserver/__init__.py
product/TimerService/timerserver/timerserver/__init__.py
+1
-1
product/ZLDAPConnection/Entry.py
product/ZLDAPConnection/Entry.py
+24
-24
product/ZMySQLDA/DA.py
product/ZMySQLDA/DA.py
+2
-2
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+5
-5
No files found.
product/ERP5/Document/AttributeUnicityConstraint.py
View file @
7e76a151
...
...
@@ -35,7 +35,7 @@ from Products.CMFCore.Expression import Expression
from
Products.ERP5Type
import
PropertySheet
from
Products.ERP5Type.Utils
import
createExpressionContext
from
Products.ERP5Type.Core.PropertyExistenceConstraint
import
\
PropertyExistenceConstraint
PropertyExistenceConstraint
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
NegatedQuery
class
AttributeUnicityConstraint
(
PropertyExistenceConstraint
):
...
...
product/ERP5/Document/CategoryRelatedMembershipStateConstraint.py
View file @
7e76a151
...
...
@@ -48,4 +48,4 @@ class CategoryRelatedMembershipStateConstraint(CategoryMembershipStateConstraint
class to simply surcharge it.
"""
return
obj
.
_getRelatedValueList
(
base_category
,
portal_type
=
portal_type_list
)
portal_type
=
portal_type_list
)
product/ERP5/Extensions/Inspect.py
View file @
7e76a151
# Simple Object Inspector
def
inspect
(
self
):
return
str
(
self
.
__dict__
)
return
str
(
self
.
__dict__
)
#return "type: %s dict:%s" % (type(o), o.__dict__)
result
=
''
return
self
.
getPhysicalPath
()
product/ERP5/TargetSolver/CopyToTarget.py
View file @
7e76a151
...
...
@@ -153,7 +153,7 @@ class CopyToTarget(TargetSolver):
simulation_movement
.
setSource
(
delivery
.
getSource
())
simulation_movement
.
setDestinationSection
(
delivery
.
getDestinationSection
())
simulation_movement
.
setSourceSection
(
delivery
.
getSourceSection
())
simulation_movement
.
edit
(
**
value_dict
)
if
parent_movement
is
not
None
and
not
parent_movement
.
isFrozen
():
...
...
product/ERP5/Tool/SimulationTool.py
View file @
7e76a151
...
...
@@ -973,7 +973,7 @@ class SimulationTool(BaseTool):
mirror_section_category - only take rows in stock table which
mirror_section_uid is member of
mirror_section_category
mirror_section_category
node_filter - only take rows in stock table which node_uid
matches node_filter
...
...
@@ -1851,7 +1851,7 @@ class SimulationTool(BaseTool):
TODO:
- make sure getInventoryHistoryList can return
cumulative values calculated by SQL (JPS)
cumulative values calculated by SQL (JPS)
"""
sql_kw
=
self
.
_generateSQLKeywordDict
(
**
kw
)
return
self
.
Resource_getInventoryHistoryList
(
...
...
product/ERP5/tests/erp5_url_checker.py
View file @
7e76a151
...
...
@@ -137,9 +137,9 @@ class URLOpener(FancyURLopener):
class
Checker
(
URLOpener
):
# This seems necessary for exceptions
# This seems necessary for exceptions
type
=
'http'
def
CheckUrl
(
self
,
url
=
None
):
try
:
thread
=
Thread
(
target
=
self
.
SearchUrl
,
args
=
(
url
,))
...
...
product/ERP5/tests/testBug.py
View file @
7e76a151
...
...
@@ -568,16 +568,16 @@ class TestBug(ERP5TypeTestCase):
if
not
run
:
return
sequence_list
=
SequenceList
()
step_list
=
[
'stepCreateBug'
,
'stepCheckBugInit'
,
'stepOpenBug'
,
'stepCheckBugInit'
,
'stepOpenBug'
,
'stepTic'
,
'stepAssignBug'
,
'stepTic'
,
'stepResolveBug'
,
'stepTic'
,
'stepAssignBug'
,
'stepTic'
,
'stepResolveBug'
,
'stepTic'
,
'stepOpenBug'
,
'stepTic'
]
]
sequence_string
=
' '
.
join
(
step_list
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
...
...
product/ERP5/tests/testBusinessTemplate.py
View file @
7e76a151
...
...
@@ -4258,9 +4258,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
CheckNotInstalledInstallationState
\
CheckPreinstallReturnSomething
\
CheckCatalogPreinstallReturnCatalogMethod
\
Tic
\
Tic
\
InstallWithoutForceBusinessTemplate
\
CheckFolderReindexActivityPresence
\
CheckFolderReindexActivityPresence
\
Tic
\
CheckInstalledInstallationState
\
CheckBuiltBuildingState
\
...
...
@@ -5039,17 +5039,17 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test is revision number is incremented with the bt is built"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
CheckInitialRevision
\
UseExportBusinessTemplate
\
CheckInitialRevision
\
BuildBusinessTemplate
\
CheckBuiltBuildingState
\
stepCheckFirstRevision
\
BuildBusinessTemplate
\
stepCheckSecondRevision
\
stepCheckFirstRevision
\
BuildBusinessTemplate
\
stepCheckSecondRevision
\
RemoveBusinessTemplate
\
RemovePortalType
\
RemovePortalType
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -5058,12 +5058,12 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if a new Business Template has no dependencies"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
UseExportBusinessTemplate
\
CheckNoMissingDependencies
\
RemoveBusinessTemplate
\
RemovePortalType
\
RemovePortalType
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -5072,13 +5072,13 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if a exception is raised when a dependency is missing"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
UseExportBusinessTemplate
\
AddDependency
\
CheckMissingDependencies
\
RemoveBusinessTemplate
\
RemovePortalType
\
RemovePortalType
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -5087,9 +5087,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if the dependency problem is fixed when the dependency is installed"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
UseExportBusinessTemplate
\
AddDependency
\
CheckMissingDependencies
\
CreateDependencyBusinessTemplate
\
...
...
@@ -5162,7 +5162,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if backup works during installation of a bt with subfolder in skin folder"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateSkinFolder
\
CheckSkinFolderExists
\
CreateSkinSubFolder
\
...
...
@@ -5188,7 +5188,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if build fails when one of the paths does not exist"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
AddPathToBusinessTemplate
\
...
...
@@ -5373,7 +5373,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
ImportBusinessTemplate
\
UseImportBusinessTemplate
\
InstallWithoutForceBusinessTemplate
\
CheckFolderReindexActivityPresence
\
CheckFolderReindexActivityPresence
\
Tic
\
\
CheckFormGroups
\
...
...
@@ -5387,9 +5387,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
\
ImportBusinessTemplate
\
UseImportBusinessTemplate
\
Tic
\
Tic
\
InstallWithoutForceBusinessTemplate
\
CheckFolderReindexActivityPresence
\
CheckFolderReindexActivityPresence
\
Tic
\
\
CheckFormGroups
\
...
...
product/ERP5/tests/testERP5eGov.py
View file @
7e76a151
...
...
@@ -159,8 +159,8 @@ class TestEgov(ERP5TypeTestCase):
"""
transaction
.
abort
()
for
module
in
[
self
.
getPersonModule
(),
self
.
getOrganisationModule
(),
]:
self
.
getOrganisationModule
(),
]:
module
.
manage_delObjects
(
list
(
module
.
objectIds
()))
vat_portal_type
=
self
.
portal
.
portal_types
.
getTypeInfo
(
'Vat Declaration'
)
...
...
@@ -327,8 +327,7 @@ class TestEgov(ERP5TypeTestCase):
type_allowed_content_type_list
.
append
(
'PDF'
)
vat_declaration
.
getTypeInfo
().
setTypeAllowedContentTypeList
(
type_allowed_content_type_list
)
vat_declaration
.
getTypeInfo
().
setTypeHiddenContentTypeList
(
type_allowed_content_type_list
)
vat_declaration
.
newContent
(
portal_type
=
'PDF'
,
title
=
'Justificatif numero 1'
)
vat_declaration
.
newContent
(
portal_type
=
'PDF'
,
title
=
'Justificatif numero 1'
)
self
.
tic
()
transaction
.
commit
()
missing_file
=
vat_declaration
.
PDFDocument_getRequirementCount
()
...
...
product/ERP5/tests/testItem.py
View file @
7e76a151
...
...
@@ -631,7 +631,7 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
packing_list_line
=
self
.
createPackingListLine
(
packing_list
=
packing_list
,
resource
=
resource
)
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
packing_list_line
.
DeliveryLine_viewItemCreationDialog
()
# create a listbox
listbox
=
({
'listbox_key'
:
'000'
,
...
...
product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py
View file @
7e76a151
...
...
@@ -42,21 +42,21 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin):
"""
Unit test for the cash balance regulation module
Source = destination
Initial cash detail :
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
Initial cash detail :
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
Ordered by Assignor
Confirmed by Assignee
Delivered by DestinationAssignee
Final cash detail :
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
Final cash detail :
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
"""
...
...
product/ERP5Banking/tests/testERP5BankingCashExchange.py
View file @
7e76a151
...
...
@@ -44,19 +44,19 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
Unit test for the cash exchange module
Source = destination
Initial cash detail :
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
Ordered by Assignor
Confirmed by Assignee
Delivered by DestinationAssignee
Final cash detail :
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
"""
...
...
@@ -503,7 +503,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
# define the sequence
sequence_string
=
'Tic CheckObjects Tic CheckInitialInventoryGuichet_1 '
\
+
'CheckInitialInventoryGuichet_2 '
\
+
'CreateCashExchange '
\
+
'CreateCashExchange '
\
+
'CreateValidIncomingLine CheckSubTotal '
\
+
'CreateValidOutgoingLine '
\
+
'Tic CheckTotal '
\
...
...
@@ -512,7 +512,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
+
'DeliverFails Tic '
\
+
'DeleteResetInventory Tic '
\
+
'DeliverCashExchange Tic '
\
+
'CheckFinalInventoryGuichet_1 '
\
+
'CheckFinalInventoryGuichet_1 '
\
+
'CheckFinalInventoryGuichet_2'
sequence_list
.
addSequenceString
(
sequence_string
)
# play the sequence
...
...
product/ERP5Banking/tests/testERP5BankingForeignCashReception.py
View file @
7e76a151
...
...
@@ -127,11 +127,11 @@ class TestERP5BankingForeignCashReception(TestERP5BankingMixin):
#and a price cooreponding to the sum of banknote of 50 and 20
#( (3) * 50 + (5) * 20 ) = 250
self
.
foreign_cash_reception
=
self
.
foreign_cash_reception_module
.
newContent
(
id
=
'foreign_cash_reception'
,
portal_type
=
'Foreign Cash Reception'
,
id
=
'foreign_cash_reception'
,
portal_type
=
'Foreign Cash Reception'
,
source_value
=
None
,
destination_value
=
self
.
reception
,
resource_value
=
self
.
currency_1
,
description
=
'test'
,
source_total_asset_price
=
250
)
source_total_asset_price
=
250
)
# set source reference
self
.
setDocumentSourceReference
(
self
.
foreign_cash_reception
)
# execute tic
...
...
product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py
View file @
7e76a151
...
...
@@ -136,7 +136,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
'variation_value'
:
(
'emission_letter/s'
,
'cash_status/cancelled'
)
+
self
.
variation_list
,
'quantity'
:
self
.
quantity_5000
}
inventory_dict_line_for_auxiliaire_1
=
{
'id'
:
'inventory_line_1'
,
'resource'
:
self
.
billet_10000
,
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
...
...
@@ -148,7 +148,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
'variation_value'
:
(
'emission_letter/p'
,
'cash_status/retired'
)
+
self
.
variation_list
,
'quantity'
:
self
.
quantity_5000
}
inventory_dict_line_for_dematerialization
=
{
'id'
:
'inventory_line_3'
,
'resource'
:
self
.
piece_200
,
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
...
...
@@ -1021,7 +1021,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
+
'StopMonetaryDestruction Tic '
\
+
'CheckSourceDebitAvailableForAuxiliaire '
\
+
'StoppedToDeliverMonetaryDestruction Tic '
\
+
'CheckSourceDebitForAuxiliaire '
\
+
'CheckSourceDebitForAuxiliaire '
\
+
'DelMonetaryDestruction Tic '
sequence_list
.
addSequenceString
(
sequence_string_auxiliare
)
...
...
@@ -1062,9 +1062,9 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
+
'StopMonetaryDestruction Tic '
\
+
'CheckSourceDebitAvailableForExterne '
\
+
'StoppedToDeliverMonetaryDestruction Tic '
\
+
'CheckSourceDebitForExterne '
\
+
'CheckSourceDebitForExterne '
\
+
'DelMonetaryDestruction Tic '
sequence_list
.
addSequenceString
(
another_sequence_string
)
# We will now do a dematerialization
...
...
@@ -1078,8 +1078,8 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
+
'SetMonetaryDestructionSourceTotalAssetPriceForDematerialization '
\
+
'PlanMonetaryDestruction '
\
+
'ValidateMonetaryDestruction '
\
+
'CheckFinalInventoryForDematerialization '
+
'CheckFinalInventoryForDematerialization '
sequence_list
.
addSequenceString
(
another_sequence_string
)
...
...
product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py
View file @
7e76a151
...
...
@@ -186,7 +186,7 @@ class TestERP5BankingMoneyDepositMixin(TestERP5BankingMixin):
self
.
money_deposit
=
self
.
money_deposit_module
.
newContent
(
id
=
'money_deposit'
,
portal_type
=
'Money Deposit'
,
destination_payment_value
=
self
.
bank_account_1
,
destination_payment_value
=
self
.
bank_account_1
,
resource_value
=
self
.
currency_1
,
description
=
'test'
,
source_total_asset_price
=
20000.0
)
...
...
product/ERP5Form/Tool/SelectionTool.py
View file @
7e76a151
...
...
@@ -1714,9 +1714,9 @@ def makeTreeList(here, form, root_dict, report_path, base_category,
tree_list
+=
[
TreeListLine
(
o
,
0
,
depth
,
0
,
selection_domain
,
exception_uid_list
)]
tree_list
+=
makeTreeList
(
here
,
form
,
new_root_dict
,
report_path
,
base_category
,
depth
+
1
,
unfolded_list
,
form_id
,
selection_name
,
report_depth
,
is_report_opened
=
is_report_opened
,
sort_on
=
sort_on
)
base_category
,
depth
+
1
,
unfolded_list
,
form_id
,
selection_name
,
report_depth
,
is_report_opened
=
is_report_opened
,
sort_on
=
sort_on
)
else
:
tree_list
+=
[
TreeListLine
(
o
,
1
,
depth
,
0
,
selection_domain
,
())]
# Summary (closed)
else
:
...
...
product/ERP5Legacy/tests/testLegacyConversionInSimulation.py
View file @
7e76a151
This diff is collapsed.
Click to expand it.
product/ERP5Type/DocumentationHelper/DCWorkflowTransitionDocumentationHelper.py
View file @
7e76a151
...
...
@@ -60,7 +60,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
if
new_state_id
:
uri
=
'%s/states/%s'
%
(
self
.
uri
.
rsplit
(
'/'
,
2
)[
0
],
new_state_id
)
return
self
.
getDocumentationHelper
(
'DCWorkflowStateDocumentationHelper'
,
uri
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTriggerType'
)
def
getTriggerType
(
self
):
...
...
product/ERP5Type/tests/testSessionTool.py
View file @
7e76a151
...
...
@@ -86,8 +86,8 @@ class TestSessionTool(ERP5TypeTestCase):
session_cache_factory
=
getattr
(
portal_caches
,
SESSION_CACHE_FACTORY
)
# remove current cache plugin
session_cache_factory
.
manage_delObjects
(
list
(
session_cache_factory
.
objectIds
()))
cache_plugin
=
session_cache_factory
.
newContent
(
portal_type
=
portal_type
)
cache_plugin
.
setCacheDuration
(
storage_duration
)
cache_plugin
=
session_cache_factory
.
newContent
(
portal_type
=
portal_type
)
cache_plugin
.
setCacheDuration
(
storage_duration
)
cache_plugin
.
setIntIndex
(
0
)
if
portal_type
==
'Distributed Ram Cache'
:
cache_plugin
.
edit
(
specialise
=
'portal_memcached/default_memcached_plugin'
)
...
...
product/Formulator/Validator.py
View file @
7e76a151
...
...
@@ -567,7 +567,7 @@ class FileValidator(Validator):
def
validate
(
self
,
field
,
key
,
REQUEST
):
value
=
REQUEST
.
get
(
key
,
None
)
if
field
.
get_value
(
'required'
)
and
value
in
(
None
,
''
):
self
.
raise_error
(
'required_not_found'
,
field
)
self
.
raise_error
(
'required_not_found'
,
field
)
return
value
FileValidatorInstance
=
FileValidator
()
...
...
product/TimerService/timerserver/timerserver/__init__.py
View file @
7e76a151
...
...
@@ -7,4 +7,4 @@ class TimerServerFactory(ServerFactory):
def
create
(
self
):
from
timerserver.TimerServer
import
TimerServer
return
TimerServer
(
self
.
module
,
self
.
interval
)
return
TimerServer
(
self
.
module
,
self
.
interval
)
product/ZLDAPConnection/Entry.py
View file @
7e76a151
...
...
@@ -154,14 +154,14 @@ class GenericEntry(Acquisition.Implicit):
### a .set calls this directly, while in the TransactionalModel this
### gets called by the Transaction system at commit time.
def
_modify
(
self
):
modlist
=
[]
modlist
=
[]
for
attribute
,
values
in
self
.
_data
.
items
():
modlist
.
append
((
ldap
.
MOD_REPLACE
,
attribute
,
values
))
for
attribute
,
values
in
self
.
_data
.
items
():
modlist
.
append
((
ldap
.
MOD_REPLACE
,
attribute
,
values
))
for
attribute
in
self
.
_mod_delete
:
modlist
.
append
((
ldap
.
MOD_DELETE
,
attribute
,
None
))
self
.
_connection
().
_modifyEntry
(
self
.
dn
,
modlist
)
self
.
_connection
().
_modifyEntry
(
self
.
dn
,
modlist
)
self
.
_mod_delete
=
[]
self
.
__subentries
=
{}
...
...
@@ -422,8 +422,8 @@ class ZopeEntry(OFS.SimpleItem.Item):
#### Initialazation Routines ##############
manage_options
=
(
{
'label'
:
'Attributes'
,
'action'
:
'manage_attributes'
},
)
{
'label'
:
'Attributes'
,
'action'
:
'manage_attributes'
},
)
__ac_permissions__
=
(
(
'Access contents information'
,
(
'manage_attributes'
,),
...
...
@@ -445,7 +445,7 @@ class ZopeEntry(OFS.SimpleItem.Item):
#### Entry & Attribute Access Machinery #####################
def
attributesMap
(
self
):
return
self
.
_data
.
items
()
return
self
.
_data
.
items
()
def
__bobo_traverse__
(
self
,
REQUEST
,
key
):
' allow traversal to subentries '
...
...
@@ -456,14 +456,14 @@ class ZopeEntry(OFS.SimpleItem.Item):
###### Tree Machinery ######
def
tpValues
(
self
):
return
self
.
_subentries
().
values
()
return
self
.
_subentries
().
values
()
def
tpId
(
self
):
return
self
.
id
return
self
.
id
def
tpURL
(
self
):
"""Return string to be used as URL relative to parent."""
return
urllib
.
quote
(
self
.
id
)
"""Return string to be used as URL relative to parent."""
return
urllib
.
quote
(
self
.
id
)
### Object Manager-ish Machinery
def
objectValues
(
self
):
...
...
@@ -478,22 +478,22 @@ class ZopeEntry(OFS.SimpleItem.Item):
### Zope management stuff
def
manage_deleteEntry
(
self
,
ids
,
REQUEST
=
None
):
'''Delete marked Entries and all their sub-entries.'''
'''Delete marked Entries and all their sub-entries.'''
for
rdn
in
ids
:
for
rdn
in
ids
:
self
.
_delete_dn
(
rdn
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
def
manage_newEntry
(
self
,
rdn
,
REQUEST
=
None
):
'''Add a new entry'''
'''Add a new entry'''
e
=
self
.
addSubentry
(
rdn
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
else
:
return
e
...
...
@@ -504,19 +504,19 @@ class ZopeEntry(OFS.SimpleItem.Item):
return
e
# return the new entry
def
manage_addAttribute
(
self
,
id
,
values
,
REQUEST
=
None
):
'''Add an attribute to an LDAP entry'''
'''Add an attribute to an LDAP entry'''
self
.
set
(
id
,
values
)
if
REQUEST
is
not
None
:
return
self
.
manage_attributes
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_attributes
(
self
,
REQUEST
)
def
manage_editAttributes
(
self
,
REQUEST
):
"""Edit entry's attributes via the web."""
for
attribute
in
self
.
_data
.
keys
():
values
=
REQUEST
.
get
(
attribute
,
[])
values
=
REQUEST
.
get
(
attribute
,
[])
values
=
filter
(
isNotBlank
,
values
)
#strip out blanks
self
.
set
(
attribute
,
values
)
...
...
product/ZMySQLDA/DA.py
View file @
7e76a151
...
...
@@ -193,6 +193,6 @@ misc_={'conn': ImageFile(
os
.
path
.
join
(
SHARED_DC_ZRDB_LOCATION
,
'www'
,
'DBAdapterFolder_icon.gif'
))}
for
icon
in
(
'table'
,
'view'
,
'stable'
,
'what'
,
'field'
,
'text'
,
'bin'
,
'int'
,
'float'
,
'date'
,
'time'
,
'datetime'
):
'field'
,
'text'
,
'bin'
,
'int'
,
'float'
,
'date'
,
'time'
,
'datetime'
):
misc_
[
icon
]
=
ImageFile
(
os
.
path
.
join
(
'icons'
,
'%s.gif'
)
%
icon
,
globals
())
product/ZMySQLDA/db.py
View file @
7e76a151
...
...
@@ -94,8 +94,8 @@ MySQLdb_version_required = (0,9,2)
_v
=
getattr
(
_mysql
,
'version_info'
,
(
0
,
0
,
0
))
if
_v
<
MySQLdb_version_required
:
raise
NotSupportedError
,
\
"ZMySQLDA requires at least MySQLdb %s, %s found"
%
\
(
MySQLdb_version_required
,
_v
)
"ZMySQLDA requires at least MySQLdb %s, %s found"
%
\
(
MySQLdb_version_required
,
_v
)
from
MySQLdb.converters
import
conversions
from
MySQLdb.constants
import
FIELD_TYPE
,
CR
,
ER
,
CLIENT
...
...
@@ -152,11 +152,11 @@ type_xlate = {
}
def
_mysql_timestamp_converter
(
s
):
if
len
(
s
)
<
14
:
s
=
s
+
"0"
*
(
14
-
len
(
s
))
if
len
(
s
)
<
14
:
s
=
s
+
"0"
*
(
14
-
len
(
s
))
parts
=
map
(
int
,
(
s
[:
4
],
s
[
4
:
6
],
s
[
6
:
8
],
s
[
8
:
10
],
s
[
10
:
12
],
s
[
12
:
14
]))
return
DateTime
(
"%04d-%02d-%02d %02d:%02d:%02d"
%
tuple
(
parts
))
return
DateTime
(
"%04d-%02d-%02d %02d:%02d:%02d"
%
tuple
(
parts
))
def
DateTime_or_None
(
s
):
try
:
return
DateTime
(
'%s UTC'
%
s
)
...
...
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