Exemple #1
0
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-

# Copyright (C) 2011 Dominic van Berkel - [email protected]
# See LICENSE for details

import sys
import execnode

pending = {}

execnode.startup(["nodes"])

stdin = execnode.getinput()

# This node depends on the irc node, so for clarity's sake we'll first wait
# for that to have loaded.
for msgobj in stdin:
    if msgobj['type'] == 'nodes':
        if 'irc' in msgobj['content']:
            break
        else:
            execnode.send(target='core',
                          type='addhooks',
                          hooks=['node_loaded'])
    elif msgobj['type'] == 'node_loaded' and msgobj['node'] == 'irc':
        break
    elif msgobj['source'] == 'core' and msgobj['type'] == 'quit':
        execnode.send(target='core',
                      type='unloaded')
        sys.exit()
Exemple #2
0
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-

# Copyright (C) 2011 Dominic van Berkel - [email protected]
# See LICENSE for details

import sys
import execnode

execnode.startup(["nodes"])

stdin = execnode.getinput()

# This node depends on the irc node, so for clarity's sake we'll first wait
# for that to have loaded.
for msgobj in stdin:
    if msgobj['type'] == 'nodes':
        if 'irc' in msgobj['content']:
            break
        else:
            execnode.send({
                'target': 'core',
                'type': 'addhooks',
                'hooks': ['node_loaded']
            })
    elif msgobj['type'] == 'node_loaded' and msgobj['node'] == 'irc':
        break
    elif msgobj['source'] == 'core' and msgobj['type'] == 'quit':
        execnode.send({'target': 'core', 'type': 'unloaded'})
        sys.exit()
Exemple #3
0
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-

# Copyright (C) 2011 Dominic van Berkel - [email protected]
# See LICENSE for details

import execnode

execnode.startup()

stdin = execnode.getinput()

for msgobj in stdin:
    if msgobj['type'] == 'haslevel':
        if msgobj['nick'] == 'nazgjunk':
            msgobj['target'] = msgobj['source']
            msgobj['result'] = 'true'
            execnode.send(msgobj)
        else:
            msgobj['target'] = msgobj['source']
            msgobj['result'] = 'false'
            execnode.send(msgobj)
    elif msgobj['source'] == 'core':
        if msgobj['type'] == 'quit':
            execnode.send(target='core',
                          type='unloaded')
            break