Example #1
0
    Returns:
        A dict with two members ("event" and "data"), with the value of "data"
        a JSON serialization of the arguments. This is the format expected by
        SseHTTPRequestHandler.
    """
    return _encode({"event": "buildInfo",
            "data": [_serialize(buildinfo)]})

# IMPORTANT: any function which may be used in the ECA rule file must be defined
# in he action_function dict
action_functions = {
	# "add_point" : ( 3, lambda input: lambda event: add_point(tuple(input[1](event))[0],tuple(input[1](event))[1],tuple(input[1](event))[2])),
	"update_gadget" : ( 1, fm.fcall1(update_gadget)),
	"add_point" : ( 3, fm.fcall3(add_point)),
    "append_point" : (3, fm.fcall3(append_point)),
	"message" : ( 1, fm.fcall1(message)),
	"create_alert_gadget" : ( 3, fm.fcall3(create_alert_gadget)),
	"alert" : ( 2, fm.fcall2(alert)),
	"create_general_chart" : ( 4, fm.fcall4(create_general_chart)),
	"create_maps_gadget" : ( 4, fm.fcall4(create_maps_gadget)),
	"add_maps_marker" : ( 4, fm.fcall4(add_maps_marker)),
	"create_tweetlist_gadget" : ( 4, fm.fcall4(create_tweetlist_gadget)),
	"add_tweetlist_tweet" : ( 2, fm.fcall2(add_tweetlist_tweet)),
	"create_wordcloud_gadget" : ( 4, fm.fcall4(create_wordcloud_gadget)),
	"send_buildinfo" : ( 1, fm.fcall1(send_buildinfo)),
	"update_wordcloud_gadget" : ( 2, fm.fcall2(update_wordcloud_gadget)),
}

if __name__ == '__main__':
    pass
Example #2
0
            identifies the build (e.g., in the form of a version number).

    Returns:
        A dict with two members ("event" and "data"), with the value of "data"
        a JSON serialization of the arguments. This is the format expected by
        SseHTTPRequestHandler.
    """
    return _encode({"event": "buildInfo",
            "data": [_serialize(buildinfo)]})

# IMPORTANT: any function which may be used in the ECA rule file must be defined
# in he action_function dict
action_functions = {
	# "add_point" : ( 3, lambda input: lambda event: add_point(tuple(input[1](event))[0],tuple(input[1](event))[1],tuple(input[1](event))[2])),
	"update_gadget" : ( 1, fm.fcall1(update_gadget)),
	"add_point" : ( 4, fm.fcall4(add_point)),
    "append_point" : (4, fm.fcall4(append_point)),
	"message" : ( 1, fm.fcall1(message)),
	"create_alert_gadget" : ( 3, fm.fcall3(create_alert_gadget)),
	"alert" : ( 2, fm.fcall2(alert)),
	"create_general_chart" : ( 4, fm.fcall4(create_general_chart)),
	"create_maps_gadget" : ( 4, fm.fcall4(create_maps_gadget)),
	"add_maps_marker" : ( 4, fm.fcall4(add_maps_marker)),
	"create_tweetlist_gadget" : ( 4, fm.fcall4(create_tweetlist_gadget)),
	"add_tweetlist_tweet" : ( 2, fm.fcall2(add_tweetlist_tweet)),
	"create_wordcloud_gadget" : ( 4, fm.fcall4(create_wordcloud_gadget)),
	"send_buildinfo" : ( 1, fm.fcall1(send_buildinfo)),
	"update_wordcloud_gadget" : ( 2, fm.fcall2(update_wordcloud_gadget)),
	"create_paniclight_gadget" : ( 4, fm.fcall4(create_paniclight_gadget)),
	"update_paniclight_gadget" : ( 2, fm.fcall2(update_paniclight_gadget)),
}
Example #3
0
    Returns:
        A dict with two members ("event" and "data"), with the value of "data"
        a JSON serialization of the arguments. This is the format expected by
        SseHTTPRequestHandler.
    """
    return _encode({"event": "buildInfo", "data": [_serialize(buildinfo)]})


# IMPORTANT: any function which may be used in the ECA rule file must be defined
# in he action_function dict
action_functions = {
    # "add_point" : ( 3, lambda input: lambda event: add_point(tuple(input[1](event))[0],tuple(input[1](event))[1],tuple(input[1](event))[2])),
    "update_gadget": (1, fm.fcall1(update_gadget)),
    "add_point": (3, fm.fcall3(add_point)),
    "append_point": (3, fm.fcall3(append_point)),
    "line_add_point": (4, fm.fcall4(line_add_point)),
    "line_append_point": (4, fm.fcall4(line_append_point)),
    "bar_update": (4, fm.fcall4(bar_update)),
    "pie_update": (4, fm.fcall4(pie_update)),
    "message": (1, fm.fcall1(message)),
    "create_alert_gadget": (3, fm.fcall3(create_alert_gadget)),
    "create_thermometer_gadget": (3, fm.fcall3(create_thermometer_gadget)),
    "update_thermometer": (2, fm.fcall2(update_thermometer)),
    "create_image_gadget": (3, fm.fcall3(create_image_gadget)),
    "update_image": (2, fm.fcall2(update_image)),
    "alert": (2, fm.fcall2(alert)),
    "create_general_chart": (4, fm.fcall4(create_general_chart)),
    "create_maps_gadget": (4, fm.fcall4(create_maps_gadget)),
    "add_maps_marker": (4, fm.fcall4(add_maps_marker)),
    "create_tweetlist_gadget": (4, fm.fcall4(create_tweetlist_gadget)),
    "add_tweetlist_tweet": (2, fm.fcall2(add_tweetlist_tweet)),
Example #4
0
    Returns:
        A dict with two members ("event" and "data"), with the value of "data"
        a JSON serialization of the arguments. This is the format expected by
        SseHTTPRequestHandler.
    """
    return _encode({"event": "buildInfo", "data": [_serialize(buildinfo)]})


# IMPORTANT: any function which may be used in the ECA rule file must be defined
# in he action_function dict
action_functions = {
    # "add_point" : ( 3, lambda input: lambda event: add_point(tuple(input[1](event))[0],tuple(input[1](event))[1],tuple(input[1](event))[2])),
    "update_gadget": (1, fm.fcall1(update_gadget)),
    "add_point": (3, fm.fcall3(add_point)),
    "append_point": (3, fm.fcall3(append_point)),
    "line_add_point": (4, fm.fcall4(line_add_point)),
    "line_append_point": (4, fm.fcall4(line_append_point)),
    "bar_update": (4, fm.fcall4(bar_update)),
    "pie_update": (4, fm.fcall4(pie_update)),
    "message": (1, fm.fcall1(message)),
    "create_alert_gadget": (3, fm.fcall3(create_alert_gadget)),
    "alert": (2, fm.fcall2(alert)),
    "create_general_chart": (4, fm.fcall4(create_general_chart)),
    "create_maps_gadget": (4, fm.fcall4(create_maps_gadget)),
    "add_maps_marker": (4, fm.fcall4(add_maps_marker)),
    "create_tweetlist_gadget": (4, fm.fcall4(create_tweetlist_gadget)),
    "add_tweetlist_tweet": (2, fm.fcall2(add_tweetlist_tweet)),
    "create_wordcloud_gadget": (4, fm.fcall4(create_wordcloud_gadget)),
    "send_buildinfo": (1, fm.fcall1(send_buildinfo)),
    "update_wordcloud_gadget": (2, fm.fcall2(update_wordcloud_gadget)),
}
Example #5
0
	if "enschede" in str:
		return actions.add_maps_marker(mapid, deg2dec(52,13,6), deg2dec(6,53,45), user)
	elif "almelo" in str:
		return actions.add_maps_marker(mapid, deg2dec(52,21,24), deg2dec(6,39,45), user)
	elif "hengelo" in str:
		return actions.add_maps_marker(mapid, deg2dec(52,15,57), deg2dec(6,47,35), user)
	elif "nijmegen" in str:
		return actions.add_maps_marker(mapid, deg2dec(51,50,33), deg2dec(5,51,10), user)
	elif "amsterdam" in str:
		return actions.add_maps_marker(mapid, deg2dec(52,22,26), deg2dec(4,53,22), user)
	elif "almere" in str:
		return actions.add_maps_marker(mapid, deg2dec(52,22,12), deg2dec(5,12,50), user)
	elif "groningen" in str:
		return actions.add_maps_marker(mapid, deg2dec(53,13,9), deg2dec(6,34,0), user)
	elif "eindhoven" in str:
		return actions.add_maps_marker(mapid, deg2dec(51,26,27), deg2dec(5,28,40), user)
	# print(str)
		
	
def show_tweet_location(mapid,nb,ol,text):
	#print(mapid, nb, ol, text)
	return actions.add_maps_marker(mapid, nb, ol, text)
	
	
builtin_functions = {
	"show_user_location" : ( 3, fm.fcall3(show_user_location)),
	"show_tweet_location" : ( 4, fm.fcall4(show_tweet_location))
}

ECA_parser.functions.update( builtin_functions )