예제 #1
0
파일: webapp.py 프로젝트: supergis/pyrocore
 def json_engine(self, req):  # pylint: disable=R0201,W0613
     """ Return torrent engine data.
     """
     try:
         return stats.engine_data(config.engine)
     except (error.LoggableError, xmlrpc.ERRORS), torrent_exc:
         raise exc.HTTPInternalServerError(str(torrent_exc))
예제 #2
0
 def json_engine(self, req):  # pylint: disable=R0201,W0613
     """ Return torrent engine data.
     """
     try:
         return stats.engine_data(config.engine)
     except (error.LoggableError, xmlrpc.ERRORS), torrent_exc:
         raise exc.HTTPInternalServerError(str(torrent_exc))
예제 #3
0
파일: webapp.py 프로젝트: supergis/pyrocore
def module_test():
    """ Quick test using…

            python -m pyrocore.daemon.webapp
    """
    import pprint
    from pyrocore import connect

    try:
        engine = connect()
        print("%s - %s" % (engine.engine_id, engine.open()))
        pprint.pprint(stats.engine_data(engine))
        print("%s - %s" % (engine.engine_id, engine.open()))
    except (error.LoggableError, xmlrpc.ERRORS), torrent_exc:
        print("ERROR: %s" % torrent_exc)
예제 #4
0
def module_test():
    """ Quick test using…

            python -m pyrocore.daemon.webapp
    """
    import pprint
    from pyrocore import connect

    try:
        engine = connect()
        print("%s - %s" % (engine.engine_id, engine.open()))
        pprint.pprint(stats.engine_data(engine))
        print("%s - %s" % (engine.engine_id, engine.open()))
    except (error.LoggableError, xmlrpc.ERRORS), torrent_exc:
        print("ERROR: %s" % torrent_exc)
예제 #5
0
파일: jobs.py 프로젝트: 01100001/pyroscope
def _flux_engine_data(engine):
    """ Return rTorrent data set for pushing to InfluxDB.
    """
    data = stats.engine_data(engine)

    # Make it flat
    data["up_rate"] = data["upload"][0]
    data["up_limit"] = data["upload"][1]
    data["down_rate"] = data["download"][0]
    data["down_limit"] = data["download"][1]
    data["version"] = data["versions"][0]
    views = data["views"]

    del data["upload"]
    del data["download"]
    del data["versions"]
    del data["views"]

    return data, views
예제 #6
0
파일: jobs.py 프로젝트: zapras/pyrocore
def _flux_engine_data(engine):
    """ Return rTorrent data set for pushing to InfluxDB.
    """
    data = stats.engine_data(engine)

    # Make it flat
    data["up_rate"] = data["upload"][0]
    data["up_limit"] = data["upload"][1]
    data["down_rate"] = data["download"][0]
    data["down_limit"] = data["download"][1]
    data["version"] = data["versions"][0]
    views = data["views"]

    del data["upload"]
    del data["download"]
    del data["versions"]
    del data["views"]

    return data, views