Esempio n. 1
0
    def copy_popup(self, w, reg, is_group=False):

        window = EntryDialog(parent=self.window,
                             flags=0,
                             type=gtk.MESSAGE_QUESTION,
                             buttons=gtk.BUTTONS_OK_CANCEL,
                             message_format="Copy Suite " + reg + """To
NAME,TOP_DIRECTORY""")

        out = window.run()
        window.destroy()
        if out:
            try:
                name, topdir = re.split(' *, *', out)
            except Exception, e:
                warning_dialog(str(e), self.window).warn()
            else:
                print name, topdir
                topdir = os.path.expanduser(os.path.expandvars(topdir))
                print name, topdir
                command = "cylc cp " + reg + ' ' + name + ' ' + topdir
                print command
                res, out = run_get_stdout(command)
                if not res:
                    warning_dialog('\n'.join(out), self.window).warn()
                elif out:
                    info_dialog('\n'.join(out), self.window).inform()
Esempio n. 2
0
    def copy_popup( self, w, reg, is_group=False ):

        window = EntryDialog( parent=self.window,
                flags=0,
                type=gtk.MESSAGE_QUESTION,
                buttons=gtk.BUTTONS_OK_CANCEL,
                message_format="Copy Suite " + reg + """To
NAME,TOP_DIRECTORY""")

        out = window.run()
        window.destroy()
        if out:
            try:
                name, topdir = re.split(' *, *', out )
            except Exception, e:
                warning_dialog( str(e), self.window ).warn()
            else:
                print name, topdir
                topdir = os.path.expanduser( os.path.expandvars( topdir ))
                print name, topdir
                command = "cylc cp " + reg + ' ' + name + ' ' + topdir
                print command
                res, out = run_get_stdout( command )
                if not res:
                    warning_dialog( '\n'.join(out), self.window ).warn()
                elif out:
                    info_dialog( '\n'.join(out), self.window ).inform()
Esempio n. 3
0
    def compare_popup(self, w, reg):

        window = EntryDialog(parent=self.window,
                             flags=0,
                             type=gtk.MESSAGE_QUESTION,
                             buttons=gtk.BUTTONS_OK_CANCEL,
                             message_format="Compare Suite " + reg + " With")

        compare = window.run()
        window.destroy()
        if compare:
            command = "cylc diff " + reg + ' ' + compare
            res, out = run_get_stdout(command)
            if not res:
                warning_dialog('\n'.join(out), self.window).warn()
            else:
                # TODO: need a bigger scrollable window here!
                info_dialog('\n'.join(out), self.window).inform()
Esempio n. 4
0
    def compare_popup( self, w, reg ):

        window = EntryDialog( parent=self.window,
                flags=0,
                type=gtk.MESSAGE_QUESTION,
                buttons=gtk.BUTTONS_OK_CANCEL,
                message_format="Compare Suite " + reg + " With")

        compare = window.run()
        window.destroy()
        if compare:
            command = "cylc diff " + reg + ' ' + compare
            res, out = run_get_stdout( command )
            if not res:
                warning_dialog( '\n'.join(out), self.window ).warn()
            else:
                # TODO: need a bigger scrollable window here!
                info_dialog( '\n'.join(out), self.window ).inform()
Esempio n. 5
0
        if response != gtk.RESPONSE_OK:
            dialog.destroy()
            return False

        fname = dialog.get_filename()
        dialog.destroy()

        try:
            f = open(fname, "wb")
        except IOError, x:
            warning_dialog(str(x), self.window).warn()
        else:
            f.write(txt)
            f.close()
            info_dialog("Buffer saved to " + fname, self.window).inform()

    def quit(self, w, e, data=None):
        if self.quit_already:
            # this is because gcylc currently maintains a list of *all*
            # gcapture windows, including those the user has closed.
            return
        self.stdout_updater.quit = True
        self.quit_already = True
        if self.standalone:
            # print 'GTK MAIN QUIT'
            gtk.main_quit()
        else:
            # print 'WINDOW DESTROY'
            self.window.destroy()
Esempio n. 6
0
        if response != gtk.RESPONSE_OK:
            dialog.destroy()
            return False

        fname = dialog.get_filename()
        dialog.destroy()

        try:
            f = open(fname, 'wb')
        except IOError, x:
            warning_dialog(str(x), self.window).warn()
        else:
            f.write(txt)
            f.close()
            info_dialog("Buffer saved to " + fname, self.window).inform()

    def quit(self, w, e, data=None):
        if self.quit_already:
            # this is because gcylc currently maintains a list of *all*
            # gcapture windows, including those the user has closed.
            return
        self.stdout_updater.stop()
        self.quit_already = True
        if self.standalone:
            gtk.main_quit()
        else:
            self.window.destroy()

    def enter_clicked(self, e):
        self.on_find_clicked(e)