示例#1
0
def main():
    '''Main application access point'''
    init_logger("install.log")

    try:
        import PyQt4
        import helioviewer.installer.gui
        helioviewer.installer.gui.install()
    except Exception as e:
        from helioviewer.installer.console import HelioviewerConsoleInstaller
        app = HelioviewerConsoleInstaller()
示例#2
0
def main():
    """Main application access point"""
    init_logger("install.log")

    try:
        import PyQt4
        import helioviewer.installer.gui

        helioviewer.installer.gui.install()
    except Exception as e:
        from helioviewer.installer.console import HelioviewerConsoleInstaller

        app = HelioviewerConsoleInstaller()
示例#3
0
def main(argv):
    '''Main application access point'''
    options = get_options()

    init_logger('update.log')

    print('Processing Images...')

    # Get a list of images to process
    filepaths = find_images(options.source)

    if len(filepaths) is 0:
        return

    images = []

    # Move images to main archive
    for filepath in filepaths:
        dest = os.path.join(options.destination,
                            os.path.relpath(filepath, options.source))

        # Parse image header
        image_params = create_image_data(filepath)
        image_params['filepath'] = dest

        images.append(image_params)

        directory = os.path.dirname(dest)

        if not os.path.isdir(directory):
            os.makedirs(directory)

        shutil.move(filepath, dest)

    # Add images to the database
    db, cursor = get_db_cursor(options.dbhost, options.dbname, options.dbuser,
                               options.dbpass)
    process_jp2_images(images, options.destination, cursor, True)
    cursor.close()

    print('Finished!')
def main(argv):
    '''Main application access point'''
    options = get_options()
    
    init_logger('update.log')
    
    print('Processing Images...')
    
    # Get a list of images to process
    filepaths = find_images(options.source)
    
    if len(filepaths) is 0:
        return

    images = []

    # Move images to main archive
    for filepath in filepaths:
        dest = os.path.join(options.destination, 
                            os.path.relpath(filepath, options.source))
        
        # Parse image header
        image_params = sunpy.read_header(filepath)
        image_params['filepath'] = dest
        
        images.append(image_params)

        directory = os.path.dirname(dest)
        
        if not os.path.isdir(directory):
            os.makedirs(directory)

        shutil.move(filepath, dest)
    
    # Add images to the database
    cursor = get_db_cursor(options.dbname, options.dbuser, options.dbpass)
    process_jp2_images(images, options.destination, cursor, True)    
    cursor.close()
    
    print('Finished!')
示例#5
0
def main():
    """Main application"""

    # Parse and validate command-line arguments
    args = get_args()
    validate_args(args, ImageRetrievalDaemon.get_servers(),
                  ImageRetrievalDaemon.get_browsers(),
                  ImageRetrievalDaemon.get_downloaders())

    # Parse configuration file
    conf = get_config(args.config)

    # Configure loggings'
    if args.log is not None:
        logfile = os.path.abspath(args.log)
    else:
        logfile = os.path.join(conf.get('directories', 'working_dir'),
                               "log/hvpull.log")
    init_logger(logfile)

    # Initialize daemon
    daemon = ImageRetrievalDaemon(args.servers, args.browse_method,
                                  args.download_method, conf)

    # Signal handlers
    def on_quit(signum, frame=None):  # pylint: disable=W0613
        daemon.shutdown()

    # Signal handlers
    signal.signal(signal.SIGQUIT, on_quit)
    signal.signal(signal.SIGINT, on_quit)

    # Begin data retrieval
    daemon.start(args.start, args.end)

    logging.info("Finished processing all files in requested time range")
    logging.info("Exiting HVPull")
def main():
    """Main application"""

    # Parse and validate command-line arguments
    args = get_args()
    validate_args(args, ImageRetrievalDaemon.get_servers(), 
                  ImageRetrievalDaemon.get_browsers(), 
                  ImageRetrievalDaemon.get_downloaders())
    
    # Parse configuration file
    conf = get_config(args.config)
    
    # Configure loggings'
    if args.log is not None:
        logfile = os.path.abspath(args.log)
    else:
        logfile = os.path.join(conf.get('directories', 'working_dir'), 
                               "log/hvpull.log")
    init_logger(logfile)
    
    # Initialize daemon
    daemon = ImageRetrievalDaemon(args.servers, args.browse_method,
                                  args.download_method, conf)

    # Signal handlers
    def on_quit(signum, frame=None): # pylint: disable=W0613
        daemon.shutdown()
        
    # Signal handlers
    signal.signal(signal.SIGQUIT, on_quit)
    signal.signal(signal.SIGINT, on_quit)
    
    # Begin data retrieval
    daemon.start(args.start, args.end)
    
    logging.info("Finished processing all files in requested time range")
    logging.info("Exiting HVPull")