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