Commit 236a77f3 authored by Rafael Monnerat's avatar Rafael Monnerat

Included a utility script get important informations. This is usefull to check...

Included a utility script get important informations. This is usefull to check if information is appropriated.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39202 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 91988caf
##############################################################################
#
# Copyright (c) 2002-2009 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
def ERP5Site_getERP5InstanceState(self, witch_login=None, witch_password=None):
"""
This script get some information from the instance. This usefull for
compare informations and verify the status of the instance.
"""
result = {}
preferences = {}
portal = self.getPortalObject()
portal_preferences = portal.portal_preferences
portal_wizard = portal.portal_wizard
# wizard authentication
if witch_password is not None and witch_login is not None:
result['witch_authentication'] = portal_wizard._isCorrectConfigurationKey(witch_login, witch_password)
else:
result['witch_authentication'] = -1
for accessor_name in ('PreferredExpressUserId',
'PreferredExpressPassword',
'PreferredWitchToolServerUrl',
'PreferredWitchToolServerRoot',
'PreferredExpressSubscriptionStatus',
'PreferredExpressErp5Uid',
'PreferredHtmlStyleAccessTab',):
preferences[accessor_name] = getattr(portal_preferences, 'get%s' % accessor_name)()
result['preference_dict'] = preferences
# bt5 list
result['bt5_list'] = [{'title': x.getTitle(),
'version': x.getVersion(),
'revision': x.getRevision()} for x in
portal.portal_templates.getInstalledBusinessTemplateList()]
return result
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>ERP5Site_getERP5InstanceState</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>WizardUtils</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getERP5InstanceState</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
152
\ No newline at end of file
153
\ No newline at end of file
WizardUtils
\ No newline at end of file
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