Esempio n. 1
0
def upload(args):
    binstar = get_binstar(args)
    uploader = Uploader(binstar, args.notebook, user=args.user, summary=args.summary,
                        version=args.version, thumbnail=args.thumbnail, name=args.name)

    try:
        upload_info = uploader.upload(force=args.force)
        log.info("{} has been uploaded.".format(args.notebook))
        log.info("You can visit your notebook at {}".format(notebook_url(upload_info)))
    except (errors.BinstarError, IOError) as e:
        log.error(str(e))
Esempio n. 2
0
def upload(args):
    binstar = get_binstar(args)
    uploader = Uploader(binstar, args.notebook, user=args.user, summary=args.summary,
                        version=args.version)

    if os.path.exists(args.notebook):
        upload_info = uploader.upload(force=args.force)
        log.info("{} has been uploaded.".format(args.notebook))
        log.info("You can visit your notebook at {}".format(notebook_url(upload_info)))
    else:
        raise errors.BinstarError("{} can't be found".format(args.notebook))

    if uploader.msg is not None:
        log.error(uploader.msg)
def upload(args):
    aserver_api = get_server_api(args.token, args.site)

    uploader = Uploader(aserver_api, args.notebook, user=args.user, summary=args.summary,
                        version=args.version, thumbnail=args.thumbnail, name=args.name)

    try:
        upload_info = uploader.upload(force=args.force)
        logger.warning("`anaconda notebook` is going to be deprecated")
        logger.warning("use `anaconda upload` instead.")
        logger.info("{} has been uploaded.".format(args.notebook))
        logger.info("You can visit your notebook at {}".format(notebook_url(upload_info)))
    except (errors.BinstarError, IOError) as e:
        logger.error(str(e))
Esempio n. 4
0
def upload(args):
    aserver_api = get_binstar(args)
    uploader = Uploader(aserver_api,
                        args.notebook,
                        user=args.user,
                        summary=args.summary,
                        version=args.version,
                        thumbnail=args.thumbnail,
                        name=args.name)

    try:
        upload_info = uploader.upload(force=args.force)
        log.info("{} has been uploaded.".format(args.notebook))
        log.info("You can visit your notebook at {}".format(
            notebook_url(upload_info)))
    except (errors.BinstarError, IOError) as e:
        log.error(str(e))
Esempio n. 5
0
def upload(args):
    aserver_api = get_server_api(args.token, args.site, args.log_level)

    uploader = Uploader(aserver_api,
                        args.notebook,
                        user=args.user,
                        summary=args.summary,
                        version=args.version,
                        thumbnail=args.thumbnail,
                        name=args.name)

    try:
        upload_info = uploader.upload(force=args.force)
        log.warn("`anaconda notebook` is going to be deprecated")
        log.warn("use `anaconda upload` instead.")
        log.info("{} has been uploaded.".format(args.notebook))
        log.info("You can visit your notebook at {}".format(
            notebook_url(upload_info)))
    except (errors.BinstarError, IOError) as e:
        log.error(str(e))
Esempio n. 6
0
 def test_anaconda_server_installation(self):
     upload_info = {'url': 'http://custom/darth/deathstart-ipynb'}
     url = 'http://custom/notebooks/darth/deathstart-ipynb'
     self.assertEqual(notebook_url(upload_info), url)
Esempio n. 7
0
 def test_anaconda_org_installation(self):
     upload_info = {'url': 'http://anaconda.org/darth/deathstart-ipynb'}
     url = 'http://notebooks.anaconda.org/darth/deathstart-ipynb'
     self.assertEqual(notebook_url(upload_info), url)
Esempio n. 8
0
 def test_anaconda_server_installation(self):
     upload_info = {'url': 'http://custom/darth/deathstart-ipynb'}
     url = 'http://custom/notebooks/darth/deathstart-ipynb'
     self.assertEqual(notebook_url(upload_info), url)
Esempio n. 9
0
 def test_anaconda_org_installation(self):
     upload_info = {'url': 'http://anaconda.org/darth/deathstart-ipynb'}
     url = 'http://notebooks.anaconda.org/darth/deathstart-ipynb'
     self.assertEqual(notebook_url(upload_info), url)