75 "return 0", self.CodeFile.initFunction), |
75 "return 0", self.CodeFile.initFunction), |
76 ("__cleanup_", "", "", self.CodeFile.cleanUpFunction), |
76 ("__cleanup_", "", "", self.CodeFile.cleanUpFunction), |
77 ("__retrieve_", "", "", self.CodeFile.retrieveFunction), |
77 ("__retrieve_", "", "", self.CodeFile.retrieveFunction), |
78 ("__publish_", "", "", self.CodeFile.publishFunction),]: |
78 ("__publish_", "", "", self.CodeFile.publishFunction),]: |
79 text += "def %s%s(%s):\n" % (func, location_str, args) |
79 text += "def %s%s(%s):\n" % (func, location_str, args) |
80 lines = code_object.gettext().splitlines() |
80 lines = code_object.gettext().strip().splitlines() |
81 if len(lines) > 0 or return_code != "": |
81 if len(lines) > 0 or return_code != "": |
82 for line in code_object.gettext().splitlines(): |
82 for line in lines: |
83 text += " " + line |
83 text += " " + line + "\n" |
84 text += " " + return_code + "\n\n" |
84 text += " " + return_code + "\n\n" |
85 else: |
85 else: |
86 text += " pass\n\n" |
86 text += " pass\n\n" |
87 |
87 |
88 return text |
88 return text |