@ -60,7 +60,7 @@ def prepare_bot( task_slug, subtask, genFactory, subtask_args ):
@rtype tuple
@rtype tuple
"""
"""
# kwargs are passed to selected bot as **kwargs
# kwargs are passed to selected bot as **kwargs
kwargs = dict ( )
kwargs = subtask_args
if not subtask or subtask == " discparser " :
if not subtask or subtask == " discparser " :
# Default case: discparser
# Default case: discparser
@ -83,6 +83,25 @@ def prepare_bot( task_slug, subtask, genFactory, subtask_args ):
return ( subtask , Bot , genFactory , kwargs )
return ( subtask , Bot , genFactory , kwargs )
def parse_red_args ( argkey , value ) :
"""
Process additional args for red . py
@param argkey The arguments key
@type argkey str
@param value The arguments value
@type value str
@return Tuple with ( key , value ) if given pair is relevant , else None
@rtype tuple or None
"""
if argkey . startswith ( " -famhash " ) :
return ( " famhash " , value )
return None
def main ( * args ) :
def main ( * args ) :
"""
"""
Process command line arguments and invoke bot .
Process command line arguments and invoke bot .
@ -110,7 +129,7 @@ def main(*args):
# Parse local Args to get information about subtask
# Parse local Args to get information about subtask
( subtask , genFactory , subtask_args ) = jogobot . bot . parse_local_args (
( subtask , genFactory , subtask_args ) = jogobot . bot . parse_local_args (
local_args )
local_args , parse_red_args )
# select subtask and prepare args
# select subtask and prepare args
( subtask , Bot , genFactory , kwargs ) = prepare_bot (
( subtask , Bot , genFactory , kwargs ) = prepare_bot (