예제 #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)
예제 #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.')
예제 #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)
예제 #4
0
def import_list(cfg, args):
    """Fetch some data """
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.import_list()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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)
예제 #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)
예제 #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()
예제 #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)
예제 #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)
예제 #14
0
def import_list(cfg, args):
    """Fetch some data """
    api = AdminApi(cfg.api_url, cfg.username, cfg.api_key)
    api.import_list()
예제 #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)
예제 #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)
예제 #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()
예제 #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()
예제 #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)
예제 #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)
예제 #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()