Commit 7e76a151 authored by Julien Muchembled's avatar Julien Muchembled

style: remove tabs in product/*.py

parent d452eb6e
......@@ -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):
......
......@@ -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)
# 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()
......@@ -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():
......
......@@ -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(
......
......@@ -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,))
......
......@@ -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)
......
......@@ -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 \
......
......@@ -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()
......
......@@ -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',
......
......@@ -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
"""
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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)
......
......@@ -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:
......
......@@ -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):
......
......@@ -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')
......
......@@ -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()
......
......@@ -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)
......@@ -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)
......
......@@ -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())
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment