[Erp5-report] r11525 - /erp5/trunk/utils/erp5mechanize/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Nov 30 10:41:41 CET 2006
Author: vincent
Date: Thu Nov 30 10:41:32 2006
New Revision: 11525
URL: http://svn.erp5.org?rev=11525&view=rev
Log:
Initial import of an erp5_html_style-friendly version of ERP5Mechanize.py .
Increase the precision of time values displayed by timerepartitionperstep.
Added:
erp5/trunk/utils/erp5mechanize/ERP5Mechanize_html.py
Modified:
erp5/trunk/utils/erp5mechanize/timerepartitionperstep.py
Added: erp5/trunk/utils/erp5mechanize/ERP5Mechanize_html.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5mechanize/ERP5Mechanize_html.py?rev=11525&view=auto
==============================================================================
--- erp5/trunk/utils/erp5mechanize/ERP5Mechanize_html.py (added)
+++ erp5/trunk/utils/erp5mechanize/ERP5Mechanize_html.py Thu Nov 30 10:41:32 2006
@@ -1,0 +1,78 @@
+#!/usr/bin/python
+##############################################################################
+#
+# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
+# Vincent Pelletier <vincent at nexedi.com>
+#
+# 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.
+#
+##############################################################################
+
+# This script is just a monkey patch of ERP5Mechanize, so we can import
+# everything it provides.
+from ERP5Mechanize import *
+
+def patched_doFavouritesMenu(self, value):
+ """
+ Go to favourite (as in 'Favourite menu') given by value.
+ """
+ return self.doMenu(value, 'favorite_select', 'Base_doFavorite:method')
+ERP5Mechanize.doFavouritesMenu = patched_doFavouritesMenu
+
+def patched_doModuleMenu(self, value):
+ """
+ Go to module (as in 'Module menu') given by value.
+ """
+ return self.doMenu(value, 'module_select', 'Base_doModule:method')
+ERP5Mechanize.doModuleMenu = patched_doModuleMenu
+
+def patched_doLanguageMenu(self, value):
+ """
+ Go to language (as in 'Language menu') given by value.
+ """
+ return self.doMenu(value, 'language_select', 'Base_doLanguage:method')
+ERP5Mechanize.doLanguageMenu = patched_doLanguageMenu
+
+def patched_doActionMenu(self, value):
+ """
+ Execute action (as in 'Action menu') given by value.
+ """
+ return self.doMenu(value, 'action_select', 'Base_doAction:method')
+ERP5Mechanize.doActionMenu = patched_doActionMenu
+
+def patched_doWorkflowAction(self, value):
+ """
+ Pass the given workflow action.
+ The transition dialog is passed.
+ The returned time takes juste the actual workflow transition in account, not the transition dialog display time.
+ """
+ self.doMenu('BaseWorkflow_viewWorkflowActionDialog?workflow_action=%s' % (value, ), 'action_select', 'Base_doAction:method')
+ return self.doAction(submit_name='Base_callViewDialogMethod:method')
+ERP5Mechanize.doWorkflowAction = patched_doWorkflowAction
+
+def patched_doJumpMenu(self, value):
+ """
+ Execute jump (as in 'Jump menu') given by value.
+ """
+ return self.doMenu(value, 'jump_select', 'Base_doJump:method')
+ERP5Mechanize.doJumpMenu = patched_doJumpMenu
+
Modified: erp5/trunk/utils/erp5mechanize/timerepartitionperstep.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5mechanize/timerepartitionperstep.py?rev=11525&r1=11524&r2=11525&view=diff
==============================================================================
--- erp5/trunk/utils/erp5mechanize/timerepartitionperstep.py (original)
+++ erp5/trunk/utils/erp5mechanize/timerepartitionperstep.py Thu Nov 30 10:41:32 2006
@@ -93,4 +93,4 @@
for value in v:
repartition[int(value/rangewidth)] += 1
for pos in xrange(len(repartition)):
- print 't<%0.2f\t: %s' % (rangewidth * (pos + 1), '#' * repartition[pos])
+ print 't<%0.8f\t: %s' % (rangewidth * (pos + 1), '#' * repartition[pos])
More information about the Erp5-report
mailing list