cherry pick resource.py & resources_rc.py from automatic_gui_testing branch