Esempio n. 1
0
def get_method_by_name(name):
	# get the geoinference class
	candidates = filter(lambda x: x.__name__ == name, gimethod_subclasses())

	if len(candidates) == 0:
		logger.fatal('No geoinference named "%s" was found.' % name)
		logger.info('Available methods are: %s' % ','.join([x.__name__ for x in gimethod_subclasses()]))
		quit()

	if len(candidates) > 1:
		logger.fatal('More than one geoinference method named "%s" was found.')
		quit()

	return candidates[0]
Esempio n. 2
0
def get_method_by_name(name):
    # get the geoinference class
    candidates = filter(lambda x: x.__name__ == name, gimethod_subclasses())

    if len(candidates) == 0:
        logger.fatal('No geoinference named "%s" was found.' % name)
        logger.info('Available methods are: %s' %
                    ','.join([x.__name__ for x in gimethod_subclasses()]))
        quit()

    if len(candidates) > 1:
        logger.fatal('More than one geoinference method named "%s" was found.')
        quit()

    return candidates[0]
Esempio n. 3
0
def ls_methods(args):
	"""
	Print out the set of methods that the tool knows about.
	"""
	for x in gimethod_subclasses():
		print '\t' + x.__name__ 
Esempio n. 4
0
def get_method_by_name(name):
	# get the geoinference class
	#print "candidatos: %s" %
	gimethod_subclasses()
	candidates =  GIMethod.__subclasses__()
	print [x.__name__ for x in candidates]
Esempio n. 5
0
from dataset import Dataset, posts2dataset
from my_sparse_dataset import SparseDataset
from geolocate import *
logger = logging.getLogger(__name__)

def get_method_by_name(name):
	# get the geoinference class
	#print "candidatos: %s" %
	gimethod_subclasses()
	candidates =  GIMethod.__subclasses__()
	print [x.__name__ for x in candidates]
	candidates = filter(lambda x: x.__name__ == name, candidates)

	if len(candidates) == 0:
		logger.fatal('No geoinference named "%s" was found.' % name)
		logger.info('Available methods are: %s' % ','.join([x.__name__ for x in gimethod_subclasses()]))
		quit()

	if len(candidates) > 1:
		logger.fatal('More than one geoinference method named "%s" was found.')
		quit()

	return candidates[0]

def ls_methods(args):
	"""
	Print out the set of methods that the tool knows about.
	"""
	for x in gimethod_subclasses():
		print '\t' + x.__name__ 
Esempio n. 6
0
def ls_methods(args):
    """
	Print out the set of methods that the tool knows about.
	"""
    for x in gimethod_subclasses():
        print '\t' + x.__name__