summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/func-create-module23
1 files changed, 4 insertions, 19 deletions
diff --git a/scripts/func-create-module b/scripts/func-create-module
index afb4d09..7cbf9eb 100755
--- a/scripts/func-create-module
+++ b/scripts/func-create-module
@@ -10,9 +10,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
TEMPLATE = """\
-from modules import func_module
-# Add your imports here
-import sub_process
+import func_module
class %s(func_module.FuncModule):
@@ -21,17 +19,7 @@ class %s(func_module.FuncModule):
api_version = "0.0.1"
description = "%s"
- def __init__(self):
- self.methods = {
%s
- }
- func_module.FuncModule.__init__(self)
-
-%s
-
-
-methods = %s()
-register_rpc = methods.register_rpc
"""
@@ -40,12 +28,9 @@ def populate_template(module_name, desc, methods):
Makes the method strings and populates the template.
"""
actual_methods = ""
- method_str_dict = ""
for method in methods:
- method_str_dict += ' "%s": self.%s,\n' % (method, method)
- actual_methods += " def self.%s(self):\n pass\n\n" % method
- return TEMPLATE % (module_name, desc,
- method_str_dict[:-1], actual_methods[:-2], module_name)
+ actual_methods += " def %s(self):\n pass\n\n" % method
+ return TEMPLATE % (module_name, desc, actual_methods[:-2])
if __name__ == '__main__':
@@ -63,4 +48,4 @@ if __name__ == '__main__':
file_obj = open(file_name, "w")
file_obj.write(populate_template(module_name, desc, methods))
file_obj.close()
- print "Your module is ready to be hacked on. Wrote out to %s." % file_name \ No newline at end of file
+ print "Your module is ready to be hacked on. Wrote out to %s." % file_name