Ejemplo n.º 1
0
def applog(cfg, args):
    """Load the applog entries."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.applog(
       args.days,
       args.status,
       args.filter)
Ejemplo n.º 2
0
def test_api_url():
    """First simple test, check build_url"""
    api_url = 'https://bmark.us/api/v1'
    username = '******'
    api_key = '123456'
    segment = 'invite'
    api = AdminApi(api_url, username, api_key)

    eq_('https://bmark.us/api/v1/a/invite?api_key=123456',
        api._build_url(segment),
        'The build url should be generated correctly.')
Ejemplo n.º 3
0
def invite_set(cfg, args):
    """Handle the invite set call to add invites to a user."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.invite_set(args.username, args.invite_ct)
Ejemplo n.º 4
0
def import_list(cfg, args):
    """Fetch some data """
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.import_list()
Ejemplo n.º 5
0
def readable_reindex(cfg, args):
    """Reindex all the bookmarks in the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.readable_reindex()
Ejemplo n.º 6
0
def invite_list(cfg, args):
    """Handle the invite list call."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.invite_status()
Ejemplo n.º 7
0
def invite_list(cfg, args):
    """Handle the invite list call."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.invite_status()
Ejemplo n.º 8
0
def to_readable(cfg, args):
    """Check the list of urls we need to readable parse still."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.to_readable()
Ejemplo n.º 9
0
def del_user(cfg, args):
    """Remove a user from the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.del_user(args.username)
Ejemplo n.º 10
0
def user_add(cfg, args):
    """Add a new user to the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.new_user(args.username, args.email)
Ejemplo n.º 11
0
def user_list(cfg, args):
    """List the users in the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.user_list()
Ejemplo n.º 12
0
def user_add(cfg, args):
    """Add a new user to the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.new_user(args.username, args.email)
Ejemplo n.º 13
0
def import_reset(cfg, args):
    """Reset an import back to reprocess"""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.import_reset(args.id)
Ejemplo n.º 14
0
def import_list(cfg, args):
    """Fetch some data """
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.import_list()
Ejemplo n.º 15
0
def invite_set(cfg, args):
    """Handle the invite set call to add invites to a user."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.invite_set(args.username, args.invite_ct)
Ejemplo n.º 16
0
def import_reset(cfg, args):
    """Reset an import back to reprocess"""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.import_reset(args.id)
Ejemplo n.º 17
0
def to_readable(cfg, args):
    """Check the list of urls we need to readable parse still."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.to_readable()
Ejemplo n.º 18
0
def user_list(cfg, args):
    """List the users in the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.user_list()
Ejemplo n.º 19
0
def applog(cfg, args):
    """Load the applog entries."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.applog(args.days, args.status, args.filter)
Ejemplo n.º 20
0
def del_user(cfg, args):
    """Remove a user from the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.del_user(args.username)
Ejemplo n.º 21
0
def readable_reindex(cfg, args):
    """Reindex all the bookmarks in the system."""
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.readable_reindex()