summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-06-15 21:18:29 +0300
committermakkalot <makkalot@gmail.com>2008-06-15 21:18:29 +0300
commita48f1c7a7a9dc1d0563f852b0fc9d506044a00fe (patch)
tree8bf5874fa7c8eaf855d1c94c77a7a6402cc5ea84
parentb5c8fc4523039556152c5e49fe01a122103487d0 (diff)
downloadthird_party-func-a48f1c7a7a9dc1d0563f852b0fc9d506044a00fe.tar.gz
third_party-func-a48f1c7a7a9dc1d0563f852b0fc9d506044a00fe.tar.xz
third_party-func-a48f1c7a7a9dc1d0563f852b0fc9d506044a00fe.zip
remove the weird duplication in widget.display
-rw-r--r--funcweb/funcweb/controllers.py15
-rw-r--r--funcweb/funcweb/widget_automation.py4
2 files changed, 10 insertions, 9 deletions
diff --git a/funcweb/funcweb/controllers.py b/funcweb/funcweb/controllers.py
index d53d01d..adf52b2 100644
--- a/funcweb/funcweb/controllers.py
+++ b/funcweb/funcweb/controllers.py
@@ -4,6 +4,7 @@ log = logging.getLogger(__name__)
from turbogears import controllers, expose, flash, identity, redirect
from func.overlord.client import Overlord, Minions
from turbogears import mochikit
+from funcweb.widget_automation import WidgetListFactory,RemoteFormAutomation,RemoteFormFactory
class Root(controllers.RootController):
@@ -52,7 +53,7 @@ class Root(controllers.RootController):
@expose(template="funcweb.templates.method_args")
#@identity.require(identity.not_anonymous())
def method_display(self,minion=None,module=None,method=None):
-
+
fc = Overlord(minion)
method_args = getattr(fc,module).get_method_args()
@@ -60,15 +61,15 @@ class Root(controllers.RootController):
print "Not registered method here"
return dict(minion_form = None)
- print method
the_one = method_args[minion][method]['args']
if the_one:
-
- from funcweb.widget_automation import WidgetListFactory,RemoteFormAutomation,RemoteFormFactory
wlist_object = WidgetListFactory(the_one)
- wlist_object=wlist_object.get_widgetlist_object()
- minion_form =RemoteFormFactory(wlist_object).get_remote_form()
- #minion_form = RemoteFormAutomation(wlist_object)
+ wlist_object = wlist_object.get_widgetlist_object()
+ #minion_form =RemoteFormFactory( wlist_object.get_widgetlist_object()).get_remote_form()
+ minion_form = RemoteFormAutomation(wlist_object)
+
+ del wlist_object
+ del the_one
#print minion_form.fields
#print minion_form
diff --git a/funcweb/funcweb/widget_automation.py b/funcweb/funcweb/widget_automation.py
index e27d865..68b4108 100644
--- a/funcweb/funcweb/widget_automation.py
+++ b/funcweb/funcweb/widget_automation.py
@@ -31,7 +31,6 @@ class WidgetListFactory(object):
'default_value':"TextArea"}
}
#will contain the input widget created in that class
- __widget_list={}
def __init__(self,argument_dict):
"""
@@ -43,7 +42,8 @@ class WidgetListFactory(object):
"""
self.__argument_dict = argument_dict
-
+ self.__widget_list={}
+
def __add_general_widget(self):
#key is the argument_name and the argument are options