Exemple #1
0
    def __init__(self, *args, **kwargs):
        """
        Build a new Clitter instance. Options passed in will override
        a ~/.clitterrc
        """
        self._conf = common.load_conf(kwargs.get('options'))
        self._api = common.load_api(self._conf)
        self._history = common.load_history(self._conf)

        for channel in ('public','friends'):
            self._fetch(channel)
        self.colors = self._color_gen()
        self.people_colors = {}
Exemple #2
0
import os
import common
import time
import logging

logging.basicConfig(level=logging.DEBUG,
        filename='daemon.log',
        filemode='a')

CONF = common.load_conf(None)
HISTORIES = common.load_history(CONF)
API = common.load_api(CONF)

def running():
    try:
        os.stat( common.RUN_FILE )
        return True
    except:
        return False
    return False

def _fetch(channel):
    try:
        if channel == "public":
            return api.GetPublicTimeline()
        elif channel == "friends":
            return api.GetFriendsTimeline(CONF.username)
    except:
        return None

def update():