コード例 #1
0
ファイル: bot.py プロジェクト: jeanbon/botounet
def main(): # {{{
    fichier_config = os.getcwd()+"/botrc"
    try:
        opts, args = parse_opts(sys.argv[1:], "")
        if args:
            fichier_config = args[0]
    except GetoptError:
        pass
    botounet = Bot(fichier_config, {"pubmsg": outils.triviallogger})
    botounet.parse_cmd(sys.argv[1:])
    botounet.start_window()
    botounet.connexion()
    if botounet.getopt("channel"): botounet.join()
    botounet.notice("jeanbon", "Je suis en ligne :)")
    #botounet.mode(botounet.channel, "+m")

    #recup_titre = RechercheTitre(botounet)
    #recup_titre.start()

    attente_entree = WaitInput(botounet)
    attente_entree.start()

    botounet.mainloop()

    #recup_titre.stop()
    #recup_titre.join()

    attente_entree.stop()
    botounet.action("Veuillez appuyer sur entrée...", log=False,
            event_type="info")
    attente_entree.join()
コード例 #2
0
ファイル: bot.py プロジェクト: jeanbon/botounet
 def parse_cmd(self, arguments):
     """
     Parse la ligne de commande et renvoie une erreur si un agument
     n'est pas reconnu
     """
     try:
         opts, args = parse_opts(arguments, "a:hc:n:s:p:g",
                 ['admin-pass='******'channel=', 'help', 'nick=', 'server=',
                 'port=', 'nickserv-pass='******'filtre-grosmots',
                 'messages-differes', 'ipv6', 'ssl', 'graphic',
                 'no-graphic'])
     except GetoptError, e:
         print "ParseError : Argument « %s » inconnu." % e.opt
         print USAGE
         sys.exit(1)