Logo Search packages:      
Sourcecode: mago version File versions  Download package

def mago::application::gnome::GEdit::save (   self,
  filename 
)

It tries to save the current opened buffer to the filename passed as parameter.

TODO: It does not manage the overwrite dialog yet.

@type filename: string
@param filename: The name of the file to save the buffer to.

Definition at line 416 of file gnome.py.

00416                             :
        """
        It tries to save the current opened buffer to the filename passed as parameter.

        TODO: It does not manage the overwrite dialog yet.

        @type filename: string
        @param filename: The name of the file to save the buffer to.
        """
        Application.save(self)
        ooldtp.context(self.name)

        try:
            ldtp.waittillguiexist(self.SAVE_DLG)
            save_dialog = ooldtp.context(self.SAVE_DLG)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The Gedit save dialog was not found."
        try:
            save_dlg_txt_filename = save_dialog.getchild(self.SAVE_DLG_TXT_NAME)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The filename txt field in Gedit save dialog was not found."
        try:
            ldtp.wait(2)
            save_dlg_txt_filename.settextvalue(filename)
        except ldtp.LdtpExecutionError:
           raise ldtp.LdtpExecutionError, "We couldn't write text."

        try:
            save_dlg_btn_save = save_dialog.getchild(self.SAVE_DLG_BTN_SAVE)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The button Save in Gedit save dialog was not found."
        
        try:
            save_dlg_btn_save.click()
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "There was an error when pushing the Save button."

        ldtp.waittillguinotexist(self.SAVE_DLG)
        ldtp.wait(1)

    def close(self, save=False, filename=''):


Generated by  Doxygen 1.6.0   Back to index