def expandmode(name):
    try:
        return common_functions.expand_abbreviations(name,
                                                     MODES.keys(),
                                                     case_sensitive=False)
    except common_functions.IllegalAbbreviationError, x:
        return None
Beispiel #2
0
def expandmode( name ):
    try:
        return common_functions.expand_abbreviations( name,
                                                      MODES.keys(),
                                                      case_sensitive = False )
    except common_functions.IllegalAbbreviationError, x:
        return None
	short = 'd'
	long = []

	try:
		opts, args = getopt.getopt(argv, short, long)
	except getopt.GetoptError, e:
		show_usage(str(e))

	for opt, value in opts:
		opt = opt.strip('-')

		if opt == 'd':
			try:
				recent_type = common_functions.expand_abbreviations( value,
											 common_functions.RECENT_TYPES,
											 case_sensitive = False )
			except common_functions.IllegalAbbreviationError, x:
				err(str(x))
		else:
			assert(False)

	if len(args) == 0:
		show_usage('Must specify run/run-parent directory.')
	
	paths = list(args)

	return recent_type, paths

####################################################################################
###
Beispiel #4
0
    recent_type = DefaultRecent

    short = 'd'
    long = []

    try:
        opts, args = getopt.getopt(argv, short, long)
    except getopt.GetoptError, e:
        show_usage(str(e))

    for opt, value in opts:
        opt = opt.strip('-')

        if opt == 'd':
            try:
                recent_type = common_functions.expand_abbreviations(
                    value, common_functions.RECENT_TYPES, case_sensitive=False)
            except common_functions.IllegalAbbreviationError, x:
                err(str(x))
        else:
            assert (False)

    if len(args) == 0:
        show_usage('Must specify run/run-parent directory.')

    paths = list(args)

    return recent_type, paths


####################################################################################
###