# Path: cyme/bin/base.py
# def app(**attrs):
#     x = attrs
# 
#     def _app(fun):
# 
#         def run(self, *args, **kwargs):
#             return fun(*args, **kwargs)
# 
#         attrs = dict({'run': run, '__module__': fun.__module__,
#                       '__doc__': fun.__doc__}, **x)
# 
#         return type(fun.__name__, (BaseApp, ), attrs)()
# 
#     return _app


from .base import app
    from cyme.branch.controller import Branch
    from celery import current_app as celery
import anyjson
"""cyme.bin.cyme_list_branches"""
from __future__ import absolute_import




def get_branches(broker=None, limit=None):
    if limit:
        limit = int(limit)

    args = [broker] if broker else []
    conn = celery.broker_connection(*args)
    return Branch(connection=conn).all(limit=limit)



# Path: cyme/bin/base.py
# def app(**attrs):
#     x = attrs
# 
#     def _app(fun):
# 
#         def run(self, *args, **kwargs):
#             return fun(*args, **kwargs)
# 
#         attrs = dict({'run': run, '__module__': fun.__module__,
#                       '__doc__': fun.__doc__}, **x)
# 
#         return type(fun.__name__, (BaseApp, ), attrs)()
# 
#     return _app


# Path: cyme/bin/cyme_list_branches.py
from .base import app
    from cyme.branch.controller import Branch
    from celery import current_app as celery
import anyjson

"""cyme.bin.cyme_list_branches"""
from __future__ import absolute_import




def get_branches(broker=None, limit=None):
    if limit:
        limit = int(limit)

    args = [broker] if broker else []
    conn = celery.broker_connection(*args)
    return Branch(connection=conn).all(limit=limit)



@app()