MCPcopy Index your code
hub / github.com/rawpython/remi / menu_save_widget_clicked

Method menu_save_widget_clicked

editor/editor.py:1081–1100  ·  view source on GitHub ↗

This method allows to export the selected widget

(self, widget, path="")

Source from the content-addressed store, hash-verified

1079 self.project.save(self.projectPathFilename, self.projectConfiguration)
1080
1081 def menu_save_widget_clicked(self, widget, path=""):
1082 """ This method allows to export the selected widget
1083 """
1084 if len(path):
1085 self.projectPathFilename = path + '/' + \
1086 self.fileSaveAsDialog.get_fileinput_value()
1087 else:
1088 self.fileSaveAsDialog.confirm_value.do(
1089 self.menu_save_widget_clicked)
1090 self.fileSaveAsDialog.show()
1091 return
1092
1093 code = ""
1094 code = code + \
1095 self.project.repr_widget_for_editor(self.selectedWidget, True)
1096 for key in self.project.code_declared_classes.keys():
1097 code_class = self.project.code_declared_classes[key]
1098 code = code + code_class
1099 with open(self.projectPathFilename, "w") as f:
1100 f.write(code)
1101
1102 def menu_export_widget_clicked(self, widget, path=""):
1103 """ This method allows to export the selected widget for app_template

Callers

nothing calls this directly

Calls 4

get_fileinput_valueMethod · 0.80
doMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected