def __init__(self, basedir=None, delta=-1, hashfunc=hashfunc, logger=logging.get_logger('zizi.cache.DiskCache')): self._is_tmp = False self._basedir = basedir self._delta = delta self._logger = logger if not self._basedir: self._basedir = tempfile.mkdtemp() self._is_tmp = True
import json from urllib import parse, request from ldotcommons import logging from ldotcommons import messaging _logger = logging.get_logger(__name__) _ENDPOINT = 'https://api.pushover.net/1/messages.json' class PushoverException(Exception): def __init__(self, *args, **kwargs): self.response = kwargs.pop('response') super(PushoverException, self).__init__(*args, **kwargs) class Pushover(messaging.Notifier): def __init__(self, api_key=None, user_key=None, priority=1): self._api_key = api_key self._user_key = user_key self._priority = priority def send(self, msg, detail=''): data = { 'token': self._api_key, 'user': self._user_key, 'message': msg, 'priority': self._priority }
def __init__(self, prog=utils.prog_name(), line_len=72): self._logger = logging.get_logger(prog) self._line_len = line_len
from ldotcommons.logging import get_logger _logger = get_logger() class WriteError(Exception): pass class ReadError(Exception): pass class UnknowElement(Exception): pass class Finish(Exception): pass class Empty(Exception): pass class EOF(Exception): pass class Element: