diff --git a/sexiibot/core.py b/sexiibot/core.py index 147ed33..2ec22e2 100644 --- a/sexiibot/core.py +++ b/sexiibot/core.py @@ -15,16 +15,26 @@ class Sexiibot(object): self.__ssl = ssl self.__channel = channel self.__nick = nick - if realname = None: - self.__realname = nick + self.__realname = realname else: self.__realname = realname self.__extensions = extensions self.__mode = None - self.__ircdir = "%s/irc/%s" % (os.environ['HOME'], server) + self.__servfifo = None + self.__chanfifo = None self.__iipath = iipath + sekf.__iiproc = None - def start(self, new=True): - if new: - - subprocess.Popen([iipath, "-s", self.__server, "-n", self.__nick, "-f", self.__realname, "-e", "ssl"]) + def start(self): + exists = os.path.isfile("%s/irc/%s/in" % (os.environ["HOME"], self.__server)) + if not self.__server is None: + # Check if a ii instance isn't already running on our potentially existing FIFO + if exists: + print("FIFO for that server already exist.") + print("Please clean the irc folder and try again.") + sys.exit(1) + cmd = [iipath, "-s", self.__server, "-n", self.__nick, "-f", self.__realnamei] + if self.__ssl: + cmd += ["-e", "ssl"] + self.__iiproc = subprocess.Popen(cmd) # self.__iiproc.terminate() later to stop +