From 3fe94fb24c6367044cf55bb523fcb887c0ea8b2f Mon Sep 17 00:00:00 2001 From: raspbeguy Date: Tue, 31 May 2016 00:10:43 +0200 Subject: [PATCH] =?UTF-8?q?bordel=20de=20pompe=20=C3=A0=20cul?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sexiibot/core.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) 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 +