コード例 #1
0
def main():
    log.configure()
    data = pkg_resources.resource_stream(__package__, '__init__.py')
    log.info('Writing local copy of v2 to v2.py...')
    with open('v2.py', 'wb') as h:
        h.write(data.read())
    log.info('Appending v2.py and VERSION to MANIFEST.in...')
    data = pkg_resources.resource_stream(__package__, 'MANIFEST.in')
    with open('MANIFEST.in', 'ab') as h:
        h.write(data.read())
コード例 #2
0
ファイル: __main__.py プロジェクト: forkkit/ahab
def ahab(connection, console=None, syslog=None):
    log.configure(stderr=console, syslog=syslog)
    log.info('Under weigh.')
    try:
        Ahab(connection).listen()
    except KeyboardInterrupt:
        log.warning("It's CTRL-C!")
    except Exception:
        log.exception("It wasn't unexpected!")
        sys.exit(2)
    log.info('Hove to.')
コード例 #3
0
 def default(event, data):
     """The default handler prints basic event info."""
     messages = defaultdict(lambda: 'Avast:')
     messages['start'] = 'Thar she blows!'
     messages['tag'] = 'Thar she blows!'
     messages['stop'] = 'Away into the depths:'
     messages['destroy'] = 'Away into the depths:'
     messages['delete'] = 'Away into the depths:'
     status = get_status(event)
     message = messages[status] + ' %s/%s'
     log.info(message, status, get_id(event))
     log.debug('"data": %s', form_json(data))
コード例 #4
0
ファイル: __main__.py プロジェクト: icehess/dockerfiles
def main():
    log.configure(stderr='debug')
    log.info('Piloting Kazoo now, Woooohooooo!')
    try:
        holaPilot()
    except Exception as e:
        log.error('It wasn\'t expected!')
        log.exception(e)
        sys.exit(2)
    except:
        log.error('python f-ed up')
        log.exception(e)
        sys.exit(2)
    log.info("What now?")
コード例 #5
0
def synchronize():
    data = sorted(ec2.instances())
    log.info('Synchronizing data for %s instances.', len(data))
    db.load(data)