示例#1
0
        # validate that each arg starts with http and ends with a port number
        validate(new_url_base, fedora_url)
    else:
        print '\nError: argument list incomplete. See usage example below.'
        usage()
        sys.exit()

    global repo
    repo = Repository(fedora_url,
                      username=fedora_username,
                      password=fedora_password)

    #Pidman Client
    global client
    client = PidmanRestClient(db_baseurl, db_username, db_password)
    connection = client._get_connection()

    current_page = 1
    count = 0
    max = 10000

    # search for existing arks by domain where type='ark', domain='LSDI'
    search_results = client.search_pids(type='ark',
                                        domain='Rushdie Collection',
                                        count=max)
    total_pages = search_results['page_count']
    page_link_1 = search_results['first_page_link']
    page_link = page_link_1[0:-1]

    print "\n=> Processing page[%d] that contains [%d] of a total of [%d] pages ..." % (
        current_page, max, total_pages)
    validate(new_url_base, fedora_url)     
  else:
    print '\nError: argument list incomplete. See usage example below.'
    usage()
    sys.exit()


  global repo
  repo = Repository(fedora_url,
                  username=fedora_username, password=fedora_password)
  

  #Pidman Client
  global client        
  client = PidmanRestClient(db_baseurl, db_username, db_password)
  connection = client._get_connection()
  
  current_page = 1
  count = 0
  max = 10000
    
  # search for existing arks by domain where type='ark', domain='LSDI'
  search_results = client.search_pids(type='ark', domain='Rushdie Collection', count=max)
  total_pages = search_results['page_count']
  page_link_1 = search_results['first_page_link']
  page_link = page_link_1[0:-1]
  
  print "\n=> Processing page[%d] that contains [%d] of a total of [%d] pages ..." %(current_page, max, total_pages)
  page_results = search_results['results']
  count = process_page(current_page, page_results)
  current_page = current_page + 1