Example #1
0
    def testLocal_EOS_JEODESK_SLSTR(self):
        source_active = False
        list_internet_id = ['EOS:S3A:SLSTR:WST', 'EOS:S3B:SLSTR:WST']
        start_date_dyn = -5
        end_date_dyn = -1

        internet_sources = querydb.get_active_internet_sources()

        for internet_id in list_internet_id:
            for s in internet_sources:
                if s.internet_id == internet_id:
                    internet_source = s
                    source_active = True

            if source_active:
                my_source = SourceEOS(
                    internet_id=internet_id,
                    url=internet_source.url,
                    descriptive_name='sentinel',
                    include_files_expression=internet_source.
                    include_files_expression,
                    pull_frequency=internet_source.pull_frequency,
                    user_name=internet_source.user_name,
                    password=internet_source.password,
                    start_date=start_date_dyn,
                    end_date=end_date_dyn,
                    frequency_id=internet_source.frequency_id,
                    type=internet_source.type,
                    files_filter_expression=internet_source.
                    files_filter_expression,
                    https_params=internet_source.https_params)

                productcode = 'slstr-sst'
                productversion = '1.0'
                product = {
                    "productcode": productcode,
                    "version": productversion
                }
                # Test download (dynamic dates

                result = get_internet.loop_get_internet(
                    test_one_source=internet_id)
                self.assertEqual(0, 0)
Example #2
0
    def testLocal_EOS_JEODESK_OLCI(self):
        source_active = False
        list_internet_id = ['EOS:S3A:OLCI:WRR', 'EOS:S3B:OLCI:WRR']
        #internet_id = 'EOS:S3A:OLCI:WRR'
        start_date_dyn = -5
        end_date_dyn = -1

        for internet_id in list_internet_id:

            internet_sources = querydb.get_active_internet_sources()
            for s in internet_sources:
                if s.internet_id == internet_id:
                    internet_source = s
                    source_active = True

            if source_active:
                my_source = SourceEOS(
                    internet_id=internet_id,
                    url=internet_source.url,
                    descriptive_name="OLCI WRR",
                    include_files_expression=internet_source.
                    include_files_expression,
                    pull_frequency=internet_source.pull_frequency,
                    user_name=internet_source.user_name,
                    password=internet_source.password,
                    start_date=start_date_dyn,
                    end_date=end_date_dyn,
                    frequency_id=internet_source.frequency_id,
                    type=internet_source.type,
                    files_filter_expression=internet_source.
                    files_filter_expression,
                    https_params=internet_source.https_params)

                productcode = 'olci-wrr'
                productversion = 'V02.0'
                product = {
                    "productcode": productcode,
                    "version": productversion
                }

                result = get_internet.loop_get_internet(
                    test_one_source=internet_id)
                self.assertEqual(0, 0)
Example #3
0
 def run(self):
     get_internet.loop_get_internet(dry_run=self.dry_run)
Example #4
0
do_start = True
dry_run = False
service = False

if service:
    # Make sure the pid dir exists
    if not os.path.isdir(es_constants.pid_file_dir):
        try:
            os.makedirs(es_constants.pid_file_dir)
        except os.error:
            logger.error("Cannot create pid directory")

    # Define pid file and create daemon
    pid_file = es_constants.get_internet_pid_filename
    daemon = acquisition.GetInternetDaemon(pid_file, dry_run=dry_run)

    if do_start:
        if daemon.status():
            logger.info('GetInternet process is running: Exit')
        else:
            logger.info('GetInternet process is NOT running: Start it.')
            daemon.start()
    else:
        if not daemon.status():
            logger.info('GetInternet process is NOT running: Exit')
        else:
            logger.info('GetInternet process is running: Stop it.')
            daemon.stop()
else:
    get_internet.loop_get_internet(dry_run=dry_run)
    if not os.path.isdir(es_constants.pid_file_dir):
        try:
            os.makedirs(es_constants.pid_file_dir)
        except os.error:
            logger.error("Cannot create pid directory")

    # Define pid file and create daemon
    pid_file = es_constants.get_internet_pid_filename
    daemon = acquisition.GetInternetDaemon(pid_file, dry_run=dry_run)

    if do_start:
        if daemon.status():
            logger.info('GetInternet process is running: Exit')
        else:
            logger.info('GetInternet process is NOT running: Start it.')
            daemon.start()
    else:
        if not daemon.status():
            logger.info('GetInternet process is NOT running: Exit')
        else:
            logger.info('GetInternet process is running: Stop it.')
            daemon.stop()
else:  # For windows version and for testing
    if only_source is not None:
        get_internet.loop_get_internet(dry_run=dry_run,
                                       test_one_source=only_source)
        logger.warning('Get internet running for a single source: %s',
                       only_source)
    else:
        get_internet.loop_get_internet(dry_run=dry_run)
dry_run  = False
service  = False

if service:
    # Make sure the pid dir exists
    if not os.path.isdir(es_constants.pid_file_dir):
        try:
            os.makedirs(es_constants.pid_file_dir)
        except os.error:
            logger.error("Cannot create pid directory")

    # Define pid file and create daemon
    pid_file = es_constants.get_internet_pid_filename
    daemon = acquisition.GetInternetDaemon(pid_file, dry_run=dry_run)

    if do_start:
        if daemon.status():
            logger.info('GetInternet process is running: Exit')
        else:
            logger.info('GetInternet process is NOT running: Start it.')
            daemon.start()
    else:
        if not daemon.status():
            logger.info('GetInternet process is NOT running: Exit')
        else:
            logger.info('GetInternet process is running: Stop it.')
            daemon.stop()
else:
    get_internet.loop_get_internet(dry_run=dry_run)

Example #7
0
 def run(self):
     get_internet.loop_get_internet(dry_run=self.dry_run)