Example #1
0
    except SystemExit:
        raise
    except:
        if globls.debug:
            traceback.print_exc()
        utils.print_exit("error: bad/missing argument(s)")

    try:
        domain = Domain(domain_home)
        if show_installed:
            # TODO: should paths or names be shown for installed and published?
            print("%s" % "\n".join(domain.get_installed()))
        if show_label:
            print("%s" % str(domain.get_label()))
        if show_published:
            print("%s" % "\n".join(domain.get_published()))
        if show_sources:
            print("%s" % str(domain.get_sources()))
        if show_subdomains:
            print("\n".join(domain.get_subdomains()))
        if show_version:
            version = domain.get_version()
            version_string = ".".join(map(str, version))
            print("%s" % version_string)
    except SystemExit:
        raise
    except utils.SSMExitException, detail:
        utils.print_exit(detail)
    except:
        if globls.debug:
            traceback.print_exc()
Example #2
0
        # check for package
        if not package.domain.is_installed(package_name):
            utils.print_exit("error: cannot find package (%s)" % package_name)

        # unpublish named package if necessary
        if publish_domain.is_published(package_name, publish_platform):
            if skip_on_published:
                utils.print_exit("skipping published package", 0)
            if not globls.force and not globls.auto_yes:
                if utils.prompt("unpublish current package (y/n)?").lower() not in ["y"]:
                    utils.print_exit("operation aborted")
            publish_domain.unpublish_package(package, publish_platform)

        # unpublish "similar" package
        for pp_path in publish_domain.get_published(publish_platform):
            pp_name = os.path.basename(pp_path)
            if package.is_similar(pp_name):
                publish_domain.unpublish_package(Package(domain, pp_name), publish_platform)

        # ready to publish
        publish_domain.publish_package(package, publish_platform)
    except SystemExit:
        raise
    except utils.SSMExitException, detail:
        utils.print_exit(detail)
    except:
        if globls.debug:
            traceback.print_exc()
        utils.print_exit("error: operation failed")
    sys.exit(0)