def extract( the_option_parser ) :
    an_options, an_args = the_option_parser.parse_args()

    from cloudflu.preferences import get_inputs
    a_study_names = get_inputs( an_args )

    return a_study_names
def extract( the_option_parser ) :
    from cloudflu.common import print_d, print_i, print_e
    
    an_options, an_args = the_option_parser.parse_args()

    from cloudflu.preferences import get_inputs
    a_source_files = get_inputs( an_args )
    print_d( "a_source_files = %s\n" % a_source_files )

    a_files = list()
    for a_file in a_source_files :
        import os.path
        if not os.path.exists( a_file ) :
            the_option_parser.error( "The given file ('%s') should exists\n" % a_file )
            pass
        a_files.append( os.path.abspath( a_file ) )
        pass
    
    if len( a_files ) == 0 :
        the_option_parser.error( "You should define one valid 'file' at least\n" )
        pass

    print_d( "a_files = %r\n" % a_files )
    
    from cloudflu import common
    a_file_locations = an_options.file_locations
    a_file_locations = a_file_locations.split( common.arg_list_separator() )

    a_file2locations = {}
    if len( a_file_locations ) > 1 :
        if len( a_files ) != len( a_file_locations ) :
            the_option_parser.error( "The amount of file locations shoudl be equal to the number of given files\n" )
            pass
        else :
            for an_id in range( len( a_files ) ) :
                a_file = a_files[ an_id ]
                a_location = a_file_locations[ an_id ]
                a_file2locations[ a_file ] = a_location
                pass
            pass
        pass
    else :
        a_location = a_file_locations[ 0 ]
        for a_file in a_files:
            a_file2locations[ a_file ] = a_location
            pass
        pass   
    
    print_d( "a_file2locations = %r\n" % a_file2locations )

    return a_file2locations
示例#3
0
def extract( the_option_parser ) :
    from cloudflu.common import print_d, print_i, print_e

    an_options, an_args = the_option_parser.parse_args()

    a_study_name = an_options.study_name
    if a_study_name == None :
        the_option_parser.error( "Use --study-name option to define proper value\n" )
        pass
    
    print_d( "a_study_name = '%s'\n" % a_study_name )

    from cloudflu.preferences import get_inputs
    a_located_files = get_inputs( an_args )

    print_d( "a_located_files = %r\n" % a_located_files )

    return a_study_name, a_located_files