Ejemplo n.º 1
0
def do_scan_remote(profile, opts, gate):
    ensure_code_reachability()
    from scan import scan, rating

    scan(profile, opts.smoonURL, gate)
    try:
        rating(profile, opts.smoonURL, gate)
    except ValueError:
        print "Could not get rating!"
Ejemplo n.º 2
0
def do_scan_remote(profile, opts, gate):
    ensure_code_reachability()
    from scan import scan, rating

    scan(profile, opts.smoonURL, gate)
    try:
        rating(profile, opts.smoonURL, gate)
    except ValueError:
        print "Could not get rating!"
Ejemplo n.º 3
0
    print _('Smolt set to checkin but checkins are disabled (hint: service smolt start)')
    sys.exit(6)

# read the profile
profile = smolt.get_profile()

if opts.new_pub:
    pub_uuid = profile.regenerate_pub_uuid(user_agent=opts.user_agent,
                              smoonURL=opts.smoonURL,
                              timeout=opts.timeout)
    print _('Success!  Your new public UUID is: %s' % pub_uuid)
    sys.exit(0)

if opts.scanOnly:
    scan(profile, opts.smoonURL)
    rating(profile, opts.smoonURL)
    sys.exit(0)

for line in profile.getProfile():
    try:
        print line
    except UnicodeEncodeError:
        pass

if not opts.autoSend:
    if opts.printOnly:
        sys.exit(0)
    else:
        try:
            send = raw_input('\n' +
                             _('Send this information to the Smolt server? (y/n)') + ' ')
Ejemplo n.º 4
0
if opts.new_pub:
    try:
        pub_uuid = profile.regenerate_pub_uuid(user_agent=opts.user_agent,
                                               smoonURL=opts.smoonURL,
                                               timeout=opts.timeout)
    except ServerError, e:
        error(_('Error contacting server: %s') % str(e))
        sys.exit(1)

    print _('Success!  Your new public UUID is: %s' % pub_uuid)
    sys.exit(0)

if opts.scanOnly:
    scan(profile, opts.smoonURL)
    rating(profile, opts.smoonURL)
    sys.exit(0)

if not opts.autoSend:
    if opts.printOnly:
        for line in profile.getProfile():
            if not line.startswith('#'):
                print line.encode('utf-8')
        sys.exit(0)

    def inner_indent(text):
        return ('\n' + 5 * ' ').join(text.split('\n'))

    excerpts = {
        'label_intro':
        _('Smolt has collected four types of information:'),