Merge branch 'master' of /home/jpt/Git/ftpbot
Conflicts: fdskun.py
This commit is contained in:
commit
b500639653
@ -26,8 +26,10 @@ class MonitorBot(irc.IRCClient):
|
|||||||
# callbacks for events
|
# callbacks for events
|
||||||
def signedOn(self):
|
def signedOn(self):
|
||||||
"""Called when bot has succesfully signed on to server."""
|
"""Called when bot has succesfully signed on to server."""
|
||||||
|
print("[signed in]")
|
||||||
self.mode(self.nickname, False, 'x')
|
self.mode(self.nickname, False, 'x')
|
||||||
self.mode(self.nickname, True, 'B')
|
self.mode(self.nickname, True, 'B')
|
||||||
|
self.msg('NickServ', 'IDENTIFY %s' % self.factory.nickserv_pw)
|
||||||
self.join(self.factory.channel)
|
self.join(self.factory.channel)
|
||||||
|
|
||||||
def joined(self, channel):
|
def joined(self, channel):
|
||||||
@ -44,9 +46,10 @@ class MonitorBotFactory(protocol.ClientFactory):
|
|||||||
A new protocol instance will be created each time we connect to the server.
|
A new protocol instance will be created each time we connect to the server.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, nickname, channel, fsmon):
|
def __init__(self, nickname, channel, nickserv_pw, fsmon):
|
||||||
self.nickname = nickname
|
self.nickname = nickname
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
|
self.nickserv_pw = nickserv_pw
|
||||||
self.fsmon = fsmon
|
self.fsmon = fsmon
|
||||||
|
|
||||||
def buildProtocol(self, addr):
|
def buildProtocol(self, addr):
|
||||||
@ -140,13 +143,14 @@ if __name__ == '__main__':
|
|||||||
port = int(config.get('irc', 'port'))
|
port = int(config.get('irc', 'port'))
|
||||||
channel = config.get('irc', 'channel')
|
channel = config.get('irc', 'channel')
|
||||||
nickname = config.get('irc', 'nickname')
|
nickname = config.get('irc', 'nickname')
|
||||||
|
nickserv_pw = config.get('irc', 'nickserv_pw')
|
||||||
realname = config.get('irc', 'realname')
|
realname = config.get('irc', 'realname')
|
||||||
path = config.get('fsmonitor', 'path')
|
path = config.get('fsmonitor', 'path')
|
||||||
|
|
||||||
fsmon = FSMonitor(path, channel)
|
fsmon = FSMonitor(path, channel)
|
||||||
|
|
||||||
# create factory protocol and application
|
# create factory protocol and application
|
||||||
f = MonitorBotFactory(nickname, channel, fsmon)
|
f = MonitorBotFactory(nickname, channel, nickserv_pw, fsmon)
|
||||||
|
|
||||||
# connect factory to this host and port
|
# connect factory to this host and port
|
||||||
reactor.connectTCP(host, port, f)
|
reactor.connectTCP(host, port, f)
|
||||||
|
@ -4,6 +4,7 @@ port = 6667
|
|||||||
nickName = FDS-kun
|
nickName = FDS-kun
|
||||||
realName = bot: provides tracking of an ftp folder
|
realName = bot: provides tracking of an ftp folder
|
||||||
channel = #JPT
|
channel = #JPT
|
||||||
|
nickserv_pw = secret
|
||||||
|
|
||||||
[fsmonitor]
|
[fsmonitor]
|
||||||
path=/tmp/foobar/
|
path=/tmp/foobar/
|
||||||
|
Loading…
Reference in New Issue
Block a user