# Path: PyChat/server/startserver.py
# def listen(host, port):
# def listenFtp(host, port):
# 
# Path: PyChat/client/error.py



import gtk
from helper import helperFunc as hf
from PyChat.server import startserver
from PyChat.client.error import __servfail__
    def save_objects(self):
        """
        Get the required objects
        """
        self.window = self.builder.get_object('mainwindow')
        self.entry = self.builder.get_object('entry')
        self.spinbutton = self.builder.get_object('spinbutton')
        self.check = self.builder.get_object('checkbutton')

    def connect(self, button):
        """
        Handles when connect button is clicked
        """
        entry = self.entry
        buf = entry.get_buffer()
        host = buf.get_text()
        if not host or not hf.validate_host(host):
            entry.grab_focus()
            return
        spin = self.spinbutton
        buf_spin = spin.get_buffer()
        port = buf_spin.get_text()
        if not port:
            spin.grab_focus()
            return
        port = int(port)
        
        obj = self.parent.get_clientobj()
        result, factory = True, None
        if self.check.get_active():

# Path: PyChat/server/startserver.py
# def listen(host, port):
# def listenFtp(host, port):
# 
# Path: PyChat/client/error.py



# Path: PyChat/client/gui/connectBoxClass.py
import gtk
from helper import helperFunc as hf
from PyChat.server import startserver
from PyChat.client.error import __servfail__

    def save_objects(self):
        """
        Get the required objects
        """
        self.window = self.builder.get_object('mainwindow')
        self.entry = self.builder.get_object('entry')
        self.spinbutton = self.builder.get_object('spinbutton')
        self.check = self.builder.get_object('checkbutton')

    def connect(self, button):
        """
        Handles when connect button is clicked
        """
        entry = self.entry
        buf = entry.get_buffer()
        host = buf.get_text()
        if not host or not hf.validate_host(host):
            entry.grab_focus()
            return
        spin = self.spinbutton
        buf_spin = spin.get_buffer()
        port = buf_spin.get_text()
        if not port:
            spin.grab_focus()
            return
        port = int(port)
        
        obj = self.parent.get_clientobj()
        result, factory = True, None
        if self.check.get_active():

            result, lisport, factory = startserver.listen(host, port)