Example #1
0
    def __init__(self, master):

        print '* Initializing'
        self.master = master
        self.sock = master.sock
        self.channels = CHANNELS

        print '* Loading brainmeats'
        self.loadbrains()

        print '* Joining channels'
        for channel in self.channels:
            self.brainmeats['channeling'].join(channel)
            self.brainmeats['channeling'].modchan(channel,
                                                  self.channels[channel])

        print '* Waking butler'
        self.butler = Butler(self)

        print '* Loading users'
        users = open(REGISTERED, 'r')
        self.REALUSERS = users.read().splitlines()
        users.close()

        print '* Connecting to datastore'
        connectdb()
Example #2
0
    def __init__(self, master):

        print '* Initializing'
        self.master = master
        self.sock = master.sock
        self.channels = CHANNELS


        print '* Loading brainmeats'
        self.loadbrains()

        print '* Joining channels'
        for channel in self.channels:
            self.brainmeats['channeling'].join(channel)
            self.brainmeats['channeling'].modchan(channel, self.channels[channel])


        print '* Waking butler'
        self.butler = Butler(self)

        print '* Loading users'
        users = open(REGISTERED, 'r')
        self.REALUSERS = users.read().splitlines()
        users.close()

        print '* Connecting to datastore'
        connectdb()
Example #3
0
    def __init__(self, master):

        print "* Initializing"
        self.values = False
        self.master = master
        self.context = CHANNEL
        self.lastpublic = False
        self.lastprivate = False
        self.lastsender = False
        self.sock = master.sock
        self.gettingnames = True
        self.members = []
        self.memories = False
        self.boredom = int(mktime(localtime()))
        self.namecheck = int(mktime(localtime()))
        self.live = {}

        self.helpmenu = {}
        self.commands = {"help": self.showlist}
        self.helpcategories = []

        print "* Loading brainmeats"
        self.loadbrains()

        print "* Connecting to datastore"
        connectdb()
Example #4
0
    def __init__(self, master):

        print '* Initializing'
        self.master = master
        self.settings = master.settings
        self.secrets = master.secrets
        self.channels = self.secrets.channels
        self.personality = self.settings.bot

        print '* Exciting neurons'
        Neurons.cortex = self

        print '* Loading brainmeats'
        self.loadbrains()

        print '* Waking butler'
        self.butler = Butler(self)

        print '* Loading users'
        self.REALUSERS = load_config(self.settings.directory.authfile)

        print '* Connecting to datastore'
        connectdb()

        print '* Evolving thalamus'
        self.thalamus = Thalamus(self)
Example #5
0
    def __init__(self, master, electroshock=False):

        print '* Initializing'
        self.master = master
        self.settings = master.settings
        self.secrets = master.secrets
        self.channels = self.secrets.channels
        self.context = self.secrets.primary_channel
        self.personality = self.settings.bot

        self.enabled = self.settings.plugins.values().pop(0)

        metacortex.botnick = self.personality.nick

        print '* Exciting neurons'
        Neurons.cortex = self

        print '* Connecting to datastore'
        connectdb()

        print '* Fondly remembering daddy'
        admin = Id(self.secrets.owner)
        if not admin.password:
            print '*' * 40
            print 'Hey %s! You haven\'t set a password yet! As my daddy you really need a password.' % self.secrets.owner
            tmp_pass = getpass(
                'Before I can continue, please enter a password: '******'See? Was that so hard?'
            admin.setpassword(tmp_pass, True)
            tmp_pass = None

        print '* Loading brainmeats'
        self.loadbrains(electroshock)
Example #6
0
    def __init__(self, master, electroshock=False):

        print '* Initializing'
        self.master = master
        self.settings = master.settings
        self.secrets = master.secrets
        self.channels = self.secrets.channels
        self.context = self.secrets.primary_channel
        self.personality = self.settings.bot

        self.enabled = self.settings.plugins.values().pop(0)

        metacortex.botnick = self.personality.nick

        print '* Exciting neurons'
        Neurons.cortex = self

        print '* Connecting to datastore'
        connectdb()

        print '* Fondly remembering daddy'
        admin = Id(self.secrets.owner)
        if not admin.password:
            print '*' * 40
            print 'Hey %s! You haven\'t set a password yet! As my daddy you really need a password.' % self.secrets.owner
            tmp_pass = getpass('Before I can continue, please enter a password: '******'See? Was that so hard?'
            admin.setpassword(tmp_pass, True)
            tmp_pass = None

        print '* Loading brainmeats'
        self.loadbrains(electroshock)
Example #7
0
    def __init__(self, master):

        print '* Initializing'
        self.master = master
        self.settings = master.settings
        self.secrets = master.secrets
        self.channels = self.secrets.channels
        self.personality = self.settings.bot

        print '* Exciting neurons'
        Neurons.cortex = self

        print '* Loading brainmeats'
        self.loadbrains()

        print '* Waking butler'
        self.butler = Butler(self)

        print '* Loading users'
        self.REALUSERS = load_config(self.settings.directory.authfile)

        print '* Connecting to datastore'
        connectdb()

        print '* Evolving thalamus'
        self.thalamus = Thalamus(self)
Example #8
0
def fetch_defaults():
    connectdb()
    cmds = {}
    for d in Defaults.objects:
        if d.command not in cmds:
            cmds[d.command] = [d.response]
        else:
            cmds[d.command].append(d.response)

    render = []
    od = collections.OrderedDict(sorted(cmds.items()))
    for k,v in od.iteritems():
        render.append({'command': k, 'response': v})
    return render
Example #9
0
    def __init__(self, master):

        print '* Initializing'
        self.master = master
        self.sock = master.sock

        print '* Loading brainmeats'
        self.loadbrains()

        print '* Waking butler'
        self.butler = Butler(self)

        print '* Loading users'
        users = open(REGISTERED, 'r')
        self.REALUSERS = users.read().splitlines()
        users.close()

        print '* Connecting to datastore'
        connectdb()
Example #10
0
    def __init__(self, master):

        print '* Initializing'
        self.master = master
        self.sock = master.sock

        print '* Loading brainmeats'
        self.loadbrains()

        print '* Waking butler'
        self.butler = Butler(self)

        print '* Loading users'
        users = open(REGISTERED, 'r')
        self.REALUSERS = users.read().splitlines()
        users.close()

        print '* Connecting to datastore'
        connectdb()
Example #11
0
def fetch_quotes():
    connectdb()
    return [q.text for q in Quote.objects]