Exemplo n.º 1
0
    def __init__(self):
        '''
        Constructor.
        '''
        self.greets = {}

        # Load the greets
        self.file = get_storage_dir(self) + 'greets.json'
        self._load()
Exemplo n.º 2
0
Arquivo: greet.py Projeto: Xion/seejoo
    def __init__(self):
        '''
        Constructor.
        '''
        self.greets = {}

        # Load the greets
        self.file = get_storage_dir(self) + 'greets.json'
        self._load()
Exemplo n.º 3
0
 def __init__(self):
     '''
     Constructor
     '''
     self.dir = get_storage_dir(self)
Exemplo n.º 4
0
Arquivo: seen.py Projeto: Xion/seejoo
    if event == 'command':  # .seen command
        user_arg = kwargs['args'].strip()
        if user_arg == irc.get_nick(kwargs['user']):
            return "You might wanna look in the mirror..."
        if user_arg == bot.nickname:
            return "Looking for me?"
        return handle_seen_command(user_arg)

    track_activity(event, **kwargs)

seen_plugin.commands = {'seen': "Reports last time when user was seen"}
register_plugin(seen_plugin)


storage_dir = get_storage_dir(seen_plugin)


# .seen command

def handle_seen_command(user):
    ''' Handle the .seen command, returning the answer: when given user
    has been last seen.
    '''
    if not user:
        return "You haven't said who you're looking for."

    user_file = os.path.join(storage_dir, user)
    if not os.path.exists(user_file):
        return "Sorry, I have never heard of '%s'." % user
Exemplo n.º 5
0
Arquivo: memo.py Projeto: Xion/seejoo
 def __init__(self):
     self.dir = get_storage_dir(self)