print message in top bar (report bar) ?

Hi guys!.

I have this code in my addon:


def updatefunct():
    if len(bpy.context.selected_objects) >= 1:
        print("good")
    else:        
        self.report({'WARNING'}, "You need selected Object/s First!")


class myProperties(bpy.types.PropertyGroup):
    bpy.types.Scene.myProp = bpy.props.FloatProperty(update=updatefunct)



But get this error:

AttributeError: 'Scene' object has no attribute 'report'

Any idea? Any solution?.

I’m trying this, but I can not:


import bpy


class debuger(bpy.types.Operator):
    bl_idname = "print.message"
    bl_label = "actions"
    def execute(self, context):
        self.report({'INFO'}, "message1")
        return {'FINISHED'}


bpy.utils.register_class(debuger)
bpy.ops.print.message()

Second one worked for me. In 2.75a console, after running the script i got: Info: message1