Beispiel #1
0
        pmu.auto_register("To sleep")

        if need_sleep:
            time.sleep(opt_sleep_secs)

        need_sleep = 1

        pmu.auto_register("downloading data")
        print "+++++++++++++ starting at ", strftime(
            "%a, %d %b %Y %H:%M:%S +0000", gmtime())

        #
        # if url specified, download .nc data files from the
        # given url using wget.
        # otherwise, download data file (not necesarily .nc type)
        # using ftp
        #
        if opt_source_base_url == "":
            pull_file_ftp()
        else:
            file_time_threshold = download_url(file_time_threshold)

        #
        # if specified date, must be single run, so exit
        #
        if opt_date_str != "":
            break

    pmu.auto_unregister()
  while 1:

    pmu.auto_register("To sleep")

    if need_sleep:
      time.sleep(opt_sleep_secs)

    need_sleep = 1

    pmu.auto_register("downloading data")
    print "+++++++++++++ starting at ", strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())

    #
    # if url specified, download .nc data files from the 
    # given url using wget.
    # otherwise, download data file (not necesarily .nc type)
    # using ftp
    #
    if opt_source_base_url == "":
      pull_file_ftp()
    else:
      file_time_threshold = download_url(file_time_threshold)

    #
    # if specified date, must be single run, so exit
    #
    if opt_date_str != "":
      break

  pmu.auto_unregister()