Esempio n. 1
0
 def on_mainWindow_destroy(self, widget):
     try:
         self.autoWC.stop_wc()
         self.autoWC.serial.close_port()
     except AttributeError:
         pass
     gtk.mainquit()
Esempio n. 2
0
def menuitem_response(w, buf):
    if buf == "_about" :
        md = gtk.MessageDialog(None,0, gtk.MESSAGE_INFO,
             gtk.BUTTONS_OK)
        md.set_markup("<b>sshlist v%s</b>" % ver)
        md.format_secondary_markup("""A simple sshmenu like replacement for appindicator menu.

To add items to menu, simply edit the file <i>.sshlist</i> in your home directory (one host per line).

Author: [email protected]
http://www.gulecha.org""")
        md.run()
        md.destroy()
    elif buf == "_refresh":
        newmenu = build_menu()
        ind.set_menu(newmenu)
        # Initialize pynotify, without this it crashes on "Refresh"
        pynotify.init("SSHList Notification")
        pynotify.Notification("sshlist refreshed","Menu list was refreshed from ~/.sshlist").show()
    elif buf == "_quit":
        newmenu = build_menu()
        ind.set_menu(newmenu)
        gtk.mainquit()
    else:
        print "gnome-terminal -x ssh " + buf + " &"
        run_program("gnome-terminal -x ssh " + buf + " &")
Esempio n. 3
0
def main_menu(action, widget):
	if action == 1:
		gui["main_entry"].set_text("")
	elif action == 2:
		gtk.mainquit()
	elif action == 3:
		prefs_window()
Esempio n. 4
0
 def winMain_destroy_cb(self, widget, data=None):
     if dlg.lastpath is not None:
         settings.setsave('dlglastpath', dlg.lastpath)
     if self.flogfile is not None:
         self.flogfile.close()
     gtk.mainquit()
     sys.exit(0)
Esempio n. 5
0
def main_menu(action, widget):
    if action == 1:
        gui["main_entry"].set_text("")
    elif action == 2:
        gtk.mainquit()
    elif action == 3:
        prefs_window()
Esempio n. 6
0
 def destroy(self, *args):
   mpitools.send_string("quit", 1)
   self.window.hide()
   gtk.mainquit()
   print "quitting main"
   sys.stdout.flush()
   sys.exit()
 def crash(self):
     import gtk
     # mainquit is deprecated in newer versions
     if hasattr(gtk, 'main_quit'):
         gtk.main_quit()
     else:
         gtk.mainquit()
Esempio n. 8
0
 def login(self, b):
     self.info.username = self.usernameEntry.get_text()
     self.info.password = self.passwordEntry.get_text()
     self.info.host = self.hostEntry.get_text()
     self.info.port = int(self.portEntry.get_text())
     self.w.hide()
     gtk.mainquit()
Esempio n. 9
0
def update_line(*args):
    if on_draw.background is None:
        return True

    print 'frame', update_line.cnt

    # restore the clean slate background
    canvas.restore_region(on_draw.background)
    # update the data
    line.set_ydata(np.sin(x+update_line.cnt/10.0))

    # just draw the animated artist
    ax.draw_artist(line)

    # just redraw the axes rectangle
    canvas.blit(ax.bbox)

    if update_line.cnt==1000:
        # print the timing info and quit
        print 'FPS:' , 1000/(time.time()-tstart)
        gtk.mainquit()
        raise SystemExit

    update_line.cnt += 1
    return True
Esempio n. 10
0
 def codeInput(self, text):
     methodName = 'do'
     if text[0] == '/':
         split = string.split(text[1:],' ',1)
         statement = split[0]
         if len(split) == 2:
             remainder = split[1]
         if statement in ('browse', 'explore'):
             methodName = 'explore'
             text = remainder
         elif statement == 'watch':
             methodName = 'watch'
             text = remainder
         elif statement == 'self_rebuild':
             rebuild.rebuild(explorer)
             if _GNOME_POWER:
                 rebuild.rebuild(spelunk_gnome)
             rebuild.rebuild(sys.modules[__name__])
             return
     try:
         self.perspective.callRemote(methodName, text)
     except pb.ProtocolError:
         # ASSUMPTION: pb.ProtocolError means we lost our connection.
         (eType, eVal, tb) = sys.exc_info()
         del tb
         s = string.join(traceback.format_exception_only(eType, eVal),
                         '')
         self.connectionLost(s)
     except:
         traceback.print_exc()
         gtk.mainquit()
 def doQuit(self, *args):
     global DO_QUIT
     if DO_QUIT == 1: gtk.mainquit()
     else:
         self.gtkpccardwin.hide()
         self.gtkpccardwin.destroy()
         self.gtkpccardwin.unmap()
Esempio n. 12
0
 def codeInput(self, text):
     methodName = 'do'
     if text[0] == '/':
         split = string.split(text[1:],' ',1)
         statement = split[0]
         if len(split) == 2:
             remainder = split[1]
         if statement in ('browse', 'explore'):
             methodName = 'explore'
             text = remainder
         elif statement == 'watch':
             methodName = 'watch'
             text = remainder
         elif statement == 'self_rebuild':
             rebuild.rebuild(explorer)
             if _GNOME_POWER:
                 rebuild.rebuild(spelunk_gnome)
             rebuild.rebuild(sys.modules[__name__])
             return
     try:
         self.perspective.callRemote(methodName, text)
     except pb.ProtocolError:
         # ASSUMPTION: pb.ProtocolError means we lost our connection.
         (eType, eVal, tb) = sys.exc_info()
         del tb
         s = string.join(traceback.format_exception_only(eType, eVal),
                         '')
         self.connectionLost(s)
     except:
         traceback.print_exc()
         gtk.mainquit()
Esempio n. 13
0
 def crash(self):
     import gtk
     # mainquit is deprecated in newer versions
     if hasattr(gtk, 'main_quit'):
         gtk.main_quit()
     else:
         gtk.mainquit()
Esempio n. 14
0
    def OnKeyPress(self, wid, event=None):

        if (event.keyval == gdk.keyval_from_name("q") or
            event.keyval == gdk.keyval_from_name("Q")):
            gtk.mainquit()
            
        
        if (event.keyval == gdk.keyval_from_name('r') or
            event.keyval == gdk.keyval_from_name('R')):
            self.Reset()
            return gtk.TRUE
        elif (event.keyval == gdk.keyval_from_name('w') or
              event.keyval == gdk.keyval_from_name('W')):
            self.Wireframe()
            return gtk.TRUE
        elif (event.keyval == gdk.keyval_from_name('s') or
              event.keyval == gdk.keyval_from_name('S')):
            self.Surface()
            return gtk.TRUE
        elif (event.keyval == gdk.keyval_from_name('p') or
              event.keyval == gdk.keyval_from_name('P')):
            m = self.get_pointer()
            self.PickActor(m[0], m[1])
            return gtk.TRUE
        else:
            return gtk.FALSE
Esempio n. 15
0
 def _DOM_ready(self):
     document = self.__webkit.GetDomDocument()
     window = self.__webkit.GetDomWindow()
     document.addEventListener('DOMNodeInserted', self._DOM_node_inserted,
                                     False)
     document.addEventListener('DOMNodeRemoved', self._DOM_node_removed,
                                     False)
     document.addEventListener('DOMAttrModified', self._DOM_node_attr_modified,
                                     False)
     document.addEventListener('DOMCharacterDataModified', self._DOM_node_data_modified,
                                     False)
     #print >> sys.stderr,  "URL:", document.URL
     #print >> sys.stderr,  "Title:", document.title
     #print >> sys.stderr,  "Cookies:", document.cookie
     #print body, dir(body)
     #print "INNER:", document.innerHTML
     #print "OUTER:", body.outerHTML
     #print dir(document)
     #print str(document)
     # Save results so that we can return it on visit() calls.
     self.result = document.title, document.cookie, document.body.outerHTML
     self.walker.walk_node(document)
     # _DOM_ready may be called before we call gtk.main() -- see
     # visit() -- in which case calling mainquit is invalid. We check
     # for that here.
     if gtk.main_level() > 0:
         gtk.mainquit()
Esempio n. 16
0
 def destroy(self, *args):
     mpitools.send_string("quit", 1)
     self.window.hide()
     gtk.mainquit()
     print "quitting main"
     sys.stdout.flush()
     sys.exit()
Esempio n. 17
0
    def OnKeyPress(self, wid, event=None):

        if (event.keyval == gdk.keyval_from_name("q")
                or event.keyval == gdk.keyval_from_name("Q")):
            gtk.mainquit()

        if (event.keyval == gdk.keyval_from_name('r')
                or event.keyval == gdk.keyval_from_name('R')):
            self.Reset()
            return gtk.TRUE
        elif (event.keyval == gdk.keyval_from_name('w')
              or event.keyval == gdk.keyval_from_name('W')):
            self.Wireframe()
            return gtk.TRUE
        elif (event.keyval == gdk.keyval_from_name('s')
              or event.keyval == gdk.keyval_from_name('S')):
            self.Surface()
            return gtk.TRUE
        elif (event.keyval == gdk.keyval_from_name('p')
              or event.keyval == gdk.keyval_from_name('P')):
            m = self.get_pointer()
            self.PickActor(m[0], m[1])
            return gtk.TRUE
        else:
            return gtk.FALSE
Esempio n. 18
0
 def __timeout_callback(self):
     debug("Timeout Callback")
     if gtk.main_level() > 0:
         gtk.mainquit()
     # Set a flag so that the main thread knows to raise a
     # TimeoutException.
     self.timed_out = True
Esempio n. 19
0
 def callback(*items):
     global x11window,doxsend
     
     data=s.recv(1024)
     if len(data)==0:
         print "Seems like Radium has died. Ending MidiProperties process."
         gtk.mainquit()
     else:
         datas=string.split(data," ",1)
         if datas[0]=="exit":
             gtk.mainquit()            
         elif datas[0]=="ToFront":
             #print "ToFront"
             #print dir(getWidget("MidiProperties").get_window())
             getWidget("MidiProperties").get_window()._raise()
             s.send('confirm')
         elif datas[0]=="UpdatePatch":
             UpdateNotEmptyPatchDo(cPickle.loads(datas[1]))
             s.send('confirm')
         elif datas[0]=="UpdateEmptyPatch":
             UpdateEmptyPatchDo(cPickle.loads(datas[1]))
             s.send('confirm')
         elif datas[0]=="SetX11Window":
             x11window=datas[1]
             doxsend=1
             s.send('confirm')
         elif datas[0]=="StopXSend":
             doxsend=0
             s.send('confirm')
         else:
             print "Unknown message "+datas[0]+" For X11_MidiProperties.py"
             s.send('confirm')
Esempio n. 20
0
 def czyzyje(self):
     print menu.stan
     if menu.stan == 0:
         self.destroy()
         gtk.mainquit()
         return False
     return True
Esempio n. 21
0
    def callback(*items):
        global x11window, doxsend

        data = s.recv(1024)
        if len(data) == 0:
            print "Seems like Radium has died. Ending MidiProperties process."
            gtk.mainquit()
        else:
            datas = string.split(data, " ", 1)
            if datas[0] == "exit":
                gtk.mainquit()
            elif datas[0] == "ToFront":
                #print "ToFront"
                #print dir(getWidget("MidiProperties").get_window())
                getWidget("MidiProperties").get_window()._raise()
                s.send('confirm')
            elif datas[0] == "UpdatePatch":
                UpdateNotEmptyPatchDo(cPickle.loads(datas[1]))
                s.send('confirm')
            elif datas[0] == "UpdateEmptyPatch":
                UpdateEmptyPatchDo(cPickle.loads(datas[1]))
                s.send('confirm')
            elif datas[0] == "SetX11Window":
                x11window = datas[1]
                doxsend = 1
                s.send('confirm')
            elif datas[0] == "StopXSend":
                doxsend = 0
                s.send('confirm')
            else:
                print "Unknown message " + datas[
                    0] + " For X11_MidiProperties.py"
                s.send('confirm')
Esempio n. 22
0
 def crash(self):
     selectreactor.SelectReactor.crash(self)
     import gtk
     # mainquit is deprecated in newer versions
     if hasattr(gtk, 'main_quit'):
         gtk.main_quit()
     else:
         gtk.mainquit()
Esempio n. 23
0
 def close(self):
   # Any way to stop the thread?
   if self.thread.isAlive():
     #self.thread.join(0)
     # Is this correct?
     self.thread._Thread__stop()
   gtk.timeout_remove(self.timer_tag)
   gtk.mainquit()
Esempio n. 24
0
def _auth_closed(pwin):
    print('auth frame closed: %s' % pwin)
    ptopwin = pwin.get_parent()
    #pwin.destroy()
    print(ptopwin)
    if ptopwin:
        ptopwin.destroy()
    gtk.mainquit()    
Esempio n. 25
0
 def destroy(self, *args):
     mpitools.broadcast_string("quit", 0)  ## args: command and sender
     self.window.hide()
     gtk.mainquit()
     print "quitting main"
     sys.stdout.flush()
     mpitools.mpi_barrier()
     sys.exit()
Esempio n. 26
0
 def uncapture(self):
     if self.first:
         print("cancel")
         self.first = None
     else:
         print("exit now")
         gtk.gdk.pointer_ungrab()
         gtk.mainquit()
Esempio n. 27
0
 def crash(self):
     selectreactor.SelectReactor.crash(self)
     import gtk
     # mainquit is deprecated in newer versions
     if hasattr(gtk, 'main_quit'):
         gtk.main_quit()
     else:
         gtk.mainquit()
Esempio n. 28
0
 def destroy(self, *args):
     mpitools.broadcast_string("quit", 0) ## args: command and sender
     self.window.hide()
     gtk.mainquit()
     print "quitting main"
     sys.stdout.flush()
     mpitools.mpi_barrier()
     sys.exit()
 def close_application(self, widget, text):
     textbuf = text.get_buffer()
     output = textbuf.get_text(textbuf.get_start_iter(), textbuf.get_end_iter())
     outfile = open(profile, "w")
     if outfile:
         outfile.write(output)
         outfile.close()
     gtk.mainquit()
Esempio n. 30
0
 def quitCallback(self):
     if self.vlc.is_alive():
         self.last_alive = time.time()
     else:
         dead_since = time.time() - self.last_alive
         if dead_since > 2:
             gtk.mainquit()
     return True
Esempio n. 31
0
def doQuit(*args):
    global DO_QUIT
    global CWIN
    if DO_QUIT == 1: gtk.mainquit()
    else:
        CWIN.hide()
        CWIN.destroy()
        CWIN.unmap()
Esempio n. 32
0
 def uncapture(self):
     if self.first:
         print "cancel"
         self.first = None
     else:
         print "exit now"
         gtk.gdk.pointer_ungrab()
         gtk.mainquit()
    def doQuit(self, *args):
        """
	Callback when we are about to exit PyVoiceChat.
	"""
        self.save_server()
        stopPyVoice()
        close_sound()
        do_cleanup()
        gtk.mainquit()
 def convertObjectsAndReRun():
     newFilename = '%s-pathed.svg' % filename
     # @TODO: make this Windows friendly
     os.system('cp "%s" "%s"' % (filename, newFilename))
     os.system(
         'inkscape --verb EditSelectAllInAllLayers --verb ObjectToPath --verb FileSave --verb FileQuit %s'
         % newFilename)
     os.system('"%s" "%s" "%s" &' %
               (sys.executable, sys.argv[0], newFilename))
     gtk.mainquit()
Esempio n. 35
0
def exit_kuaipan(param):
    print(param)

    # stop monitor thread
    stop_monitor()    
    
    #stop sync thread
    stop_sync()
    
    gtk.mainquit()
 def do_ok(self, button=None):  # modified here by Erica Andrews
     if not self.UPDATER == None:
         if not self.selected[1] == None:
             self.UPDATER(self.selected[1])
             self.destroy()
             self.unmap()
             gtk.mainquit()
     else:
         self.destroy()
         self.ummap()
         gtk.mainquit()
Esempio n. 37
0
def update_line(*args):
    print 'you are here', update_line.cnt
    if update_line.background is None:
        update_line.background = canvas.copy_from_bbox(ax.bbox)
    canvas.restore_region(update_line.background)
    line.set_ydata(np.sin(x+update_line.cnt/10.0))
    ax.draw_artist(line)
    canvas.blit(ax.bbox)
    if update_line.cnt==1000:
        print 'FPS:' , 1000/(time.time()-tstart)
        gtk.mainquit()
        raise SystemExit
    update_line.cnt += 1
    return True
Esempio n. 38
0
    def __init__(self,  ):
        TARGET_STRING = 82
        TARGET_IMAGE = 83
        self.file_list = []
        self.accepted_types = ["jpg", "jpeg", "png", "gif", "bmp"]

        win = gtk.Window()
        win.set_size_request(400, 400)
        win.connect("delete_event", lambda w,e: gtk.mainquit())

        vbox = gtk.VBox(False, 0)
        hello = gtk.Label("Test label to drag images to.")
        vbox.pack_start(hello, True, True, 0)
        win.add(vbox)

        if sys.platform=="win32":
            win.drag_dest_set(0, [], 0)
        else:
            win.drag_dest_set(gtk.DEST_DEFAULT_DROP, 
                    [("text/plain", 0, TARGET_STRING),
                        ("image/*", 0, TARGET_IMAGE)],
                    gtk.gdk.ACTION_COPY)

        win.connect("drag_motion", self.motion_cb)
        win.connect("drag_drop", self.drop_cb)
        win.connect("drag_data_received", self.drag_data_received)
        win.show_all()
Esempio n. 39
0
 def __init__(self,  ):
     super(TreeViewExample, self).__init__()
     self.counter = 0
     self.win = gtk.Window()
     self.win.set_size_request(400, 400)
     self.win.connect("delete_event", lambda w,e: gtk.mainquit())
     vbox = gtk.VBox(False, 0)
     hbox = gtk.HBox(False, 0)
     add_button = gtk.Button("Add Item")
     add_button.connect("clicked", self.add_button_clicked)
     remove_button = gtk.Button("Remove Item")
     remove_button.connect("clicked", self.remove_button_clicked)
     #Treeview Stuff
     self.liststore = gtk.ListStore(str, str)
     self.treeview = gtk.TreeView(self.liststore)
     #Add cell and column.
     #data added to treeview.
     self.cell = gtk.CellRendererText()
     self.cell2 = gtk.CellRendererText()
     # text = number is the column the text is displayd from 
     self.treeviewcolumn = gtk.TreeViewColumn("Button Pushed", self.cell, text=0)
     self.treeviewcolumn2 = gtk.TreeViewColumn("Second Useless Column", self.cell2, text=1)
     self.treeview.append_column(self.treeviewcolumn)
     self.treeview.append_column(self.treeviewcolumn2)
     vbox.pack_start(self.treeview, True, True, 0)
     vbox.pack_start(hbox, False, True, 0)
     hbox.pack_start(add_button, True, True, 0)
     hbox.pack_start(remove_button, True, True, 0)
     self.win.add(vbox)
     self.win.show_all()
Esempio n. 40
0
    def sendMessage(self, unused_data=None):
        text = self.get_chars(0,-1)
        if self.linemode:
            self.blockcount = self.blockcount + 1
            fmt = ">>> # begin %s\n%%s\n#end %s\n" % (
                self.blockcount, self.blockcount)
        else:
            fmt = ">>> %s\n"
        self.history.append(text)
        self.histpos = len(self.history)
        self.toplevel.output.console([['command',fmt % text]])

        method = self.toplevel.perspective.do

        if text[0] == '/':
            split = string.split(text[1:],' ',1)
            statement = split[0]
            if len(split) == 2:
                remainder = split[1]
            if statement == 'browse':
                method = self.toplevel.perspective.browse
                text = remainder
            elif statement == 'watch':
                method = self.toplevel.perspective.watch
                text = remainder
            elif statement == 'self_rebuild':
                rebuild.rebuild(explorer)
                if _GNOME_POWER:
                    rebuild.rebuild(gnomehole)
                rebuild.rebuild(sys.modules[__name__])
                return
        try:
            method(text)
        except pb.ProtocolError:
            # ASSUMPTION: pb.ProtocolError means we lost our connection.
            (eType, eVal, tb) = sys.exc_info()
            del tb
            s = string.join(traceback.format_exception_only(eType, eVal),
                            '')
            self.toplevel.connectionLost(s)
        except:
            traceback.print_exc()
            gtk.mainquit()
Esempio n. 41
0
def click_handler(event):
	#Create the "Are you sure" dialog
	msgbox = gnome.ui.GnomeMessageBox(
		"Are you sure you want to quit?", 
		gnome.ui.MESSAGE_BOX_QUESTION, 
		gnome.ui.STOCK_BUTTON_YES, 
		gnome.ui.STOCK_BUTTON_NO)
	msgbox.set_modal(1)
	msgbox.show()

	result = msgbox.run_and_close()

	#Button 0 is the Yes button.  If this is the
	#button they clicked on, tell GNOME to quit
	#it's event loop.  Otherwise, do nothing
	if (result == 0):
		gtk.mainquit()	

	return 0
Esempio n. 42
0
    def code_exec(self):
        """Execute waiting code.  Called every timeout period."""
        self.ready.acquire()
        if self._kill: gtk.mainquit()
        if self.new_cmd != None:
            self.ready.notify()
            self.cmd = self.cmd + self.new_cmd
            self.new_cmd = None
            try:
                code = codeop.compile_command(self.cmd[:-1])
                if code:
                    self.cmd = ''
                    exec(code, self.globs, self.locs)
                    self.completer.update(self.locs)
            except Exception:
                traceback.print_exc()
                self.cmd = ''

        self.ready.release()
        return 1
Esempio n. 43
0
 def code_exec (self):
     """Execute waiting code.  Called every timeout period."""
     self.ready.acquire ()
     if self._kill: gtk.mainquit ()
     if self.new_cmd != None:  
         self.ready.notify ()  
         self.cmd = self.cmd + self.new_cmd
         self.new_cmd = None
         try:
             code = codeop.compile_command (self.cmd[:-1]) 
             if code: 
                 self.cmd = ''
                 exec (code, self.globs, self.locs)
                 self.completer.update (self.locs)
         except Exception:
             traceback.print_exc ()
             self.cmd = ''  
                                 
     self.ready.release()
     return 1 
Esempio n. 44
0
    def sendMessage(self, unused_data=None):
        text = self.get_chars(0, -1)
        if self.linemode:
            self.blockcount = self.blockcount + 1
            fmt = ">>> # begin %s\n%%s\n#end %s\n" % (self.blockcount, self.blockcount)
        else:
            fmt = ">>> %s\n"
        self.history.append(text)
        self.histpos = len(self.history)
        self.toplevel.output.console([["command", fmt % text]])

        method = self.toplevel.perspective.do

        if text[0] == "/":
            split = string.split(text[1:], " ", 1)
            statement = split[0]
            if len(split) == 2:
                remainder = split[1]
            if statement == "browse":
                method = self.toplevel.perspective.browse
                text = remainder
            elif statement == "watch":
                method = self.toplevel.perspective.watch
                text = remainder
            elif statement == "self_rebuild":
                rebuild.rebuild(explorer)
                if _GNOME_POWER:
                    rebuild.rebuild(gnomehole)
                rebuild.rebuild(sys.modules[__name__])
                return
        try:
            method(text)
        except pb.ProtocolError:
            # ASSUMPTION: pb.ProtocolError means we lost our connection.
            (eType, eVal, tb) = sys.exc_info()
            del tb
            s = string.join(traceback.format_exception_only(eType, eVal), "")
            self.toplevel.connectionLost(s)
        except:
            traceback.print_exc()
            gtk.mainquit()
Esempio n. 45
0
    def on_query_key_press_event (self, query, event):
        # handle history browsing and auto-completion
        if (self.handle_special_keys(query, event) == gtk.TRUE):
            return gtk.TRUE;

        # clear out our history prefix because it's in the text field now
        # and we'll grab it again if we need it
        self.hispref = None;
        self.hisidx = -1;

        # if they pressed return, map that to a special binding
        if (event.keyval == gtk.keysyms.Return):
            binding = bindings.Binding("", bindings.Binding.URL, "", "%T");

        else:
            # ignore plain or shifted keystrokes
            if (event.state <= 1):
                return gtk.FALSE;
            # convert the key press into a string
            keystr = keyval_util.convert_keyval_state_to_string(
                event.keyval, event.state);
            # look up a binding for that key string
            binding = self.bindings.get_match(keystr);

        # if we found one, invoke it
        if (binding != None):
            text = query.get_text();
            binding.invoke(text);
            # append this entry to our history
            self.history.append(text);
            # and either bail or get ready for the next go
            if (self.appletMode):
                query.set_text("");
            else:
                gtk.mainquit();
            return gtk.TRUE;

        else:
            # otherwise, let GTK know that we didn't handle the key press
            return gtk.FALSE;
Esempio n. 46
0
 def ok_cb (self, *args):
     if not self.current_db:
         de.show_message(label='No database selected.',
                         sublabel='You need to select a database system.')
     else:
         self.retdic = {'db_backend':self.current_db}
         if self.current_db in self.need_connection_info:
             for e in self.connection_widgets:
                 if e.find('Entry') >= 0:
                     self.retdic[e[0:e.find('Entry')]]=getattr(self,e).get_text()
             self.retdic['store_pw']=self.pwCheckButton.get_active()
         if self.current_db in self.need_file_info:
             fi = self.fileEntry.get_text()
             if fi and fi.find(os.path.sep) < 0:
                 fi = os.path.join(self.default_file_directory,fi)
             self.retdic['file']=fi
         self.window.hide()
         self.window.destroy()
         if self._okcb: self._okcb(self.retdic)
         if self.modal:
             gtk.mainquit()
         return self.retdic
Esempio n. 47
0
    def _DOM_ready(self):
        document = self.__webkit.GetDomDocument()
        body = document.getElementsByTagName('body').item(0)
        if not body:
            return

        window = self.__webkit.GetDomWindow()
        document.addEventListener('DOMNodeInserted', self._DOM_node_inserted,
                                        False)
        document.addEventListener('DOMNodeRemoved', self._DOM_node_removed,
                                        False)
        document.addEventListener('DOMAttrModified', self._DOM_node_attr_modified,
                                        False)
        document.addEventListener('DOMCharacterDataModified', self._DOM_node_data_modified,
                                        False)
        logfile.write(" [worker"+str(wid)+"] URL: " + str(document.URL)+"\n")
        logfile.write(" [worker"+str(wid)+"] Title: " + str(document.title)+"\n")
        #print >> sys.stderr,  "URL:", document.URL
        #print >> sys.stderr,  "Title:", document.title
        #print >> sys.stderr,  "Cookies:", document.cookie
        DOMWalker(self.__fastcrawl,self.__rdepth,self.__maxurl2add).walk_node(document)
        self.__rdepth = None
        gtk.mainquit()
Esempio n. 48
0
 def on_delete(self, *args):
     gtk.mainquit()
Esempio n. 49
0
 def crash(self):
     gtk.mainquit()
 def on_delete(self, win, event):
     self.selected = (None, None)
     self.destroy()
     self.unmap()
     gtk.mainquit()
 def do_close(self, button=None):  # modified here by Erica Andrews
     self.selected = (None, None)
     self.destroy()
     self.unmap()
     gtk.mainquit()
 def quit(self, *args):
     self.hide()
     self.destroy()
     gtk.mainquit()
Esempio n. 53
0
 def destroy(self, data):
     gtk.mainquit()
    def doQuit(self,*args):
	gtk.mainquit()
def doQuit(*args):
    gtk.mainquit()