Rotate and scale edges around cursor

Hi,
I’m trying to rotate selected vertices/edges around the cursor (which is casually at center, as the origin of the mesh too, should be easy) around the Z axis. But they always rotate around their median point. My last two instructions are

bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.extrude(type='EDGES')

On the same way, I would then like to scale them also with the cursor as center of the transformation.
Which operator or group of operators should I use ? (All the pieces of codes that I found don’t work).

Thanks in advance for your help.

Lol don’t use python scripting. When in editmode, put your cursor in the center of mesh, then on the same line where it says view, mesh and all those buttons, click the button that looks like it has two cones coming to one point (kinda looks like a satellite) and press around cursor. Now if you want it to go to the other side of the mesh, you don’t rotate it around, but instead scale the vertices to the other side by pressing Shift D then S,X,-1(scaling across the x-axis -1 times) and boom. Be aware though that this is not a mirror but actually a duplication.

Thanks a lot, Jutomana, I know how to do it manually.
I am writing a script, and that’s why I am presently posting in this script section.

you could try something like this:

# Classes for VIEW3D_MT_CursorMenu()
class VIEW3D_OT_pivot_cursor(bpy.types.Operator):
    "Cursor as Pivot Point"
    bl_idname = "view3d.pivot_cursor"
    bl_label = "Cursor as Pivot Point"

    @classmethod
    def poll(cls, context):
        return bpy.context.space_data.pivot_point != 'CURSOR'

    def execute(self, context):
        bpy.context.space_data.pivot_point = 'CURSOR'
        return {'FINISHED'}

class VIEW3D_OT_revert_pivot(bpy.types.Operator):
    "Revert Pivot Point"
    bl_idname = "view3d.revert_pivot"
    bl_label = "Reverts Pivot Point to median"

    @classmethod
    def poll(cls, context):
        return bpy.context.space_data.pivot_point != 'MEDIAN_POINT'

    def execute(self, context):
        bpy.context.space_data.pivot_point = 'MEDIAN_POINT'
        # @todo Change this to 'BOUDNING_BOX_CENTER' if needed...
        return{'FINISHED'}

hope it helps.

Thank you much, Meta. I’ll try that this evening !
Have a good day !

EDIT : No way, it doesn’t help.
In fact if I could find an easy to use rotate function with a rotation axis such as X Y or Z, I think that I could manage to achieve what I’m looking for.

Solved. Three links to give clues :
rarebit solution http://blenderartists.org/forum/archive/index.php/t-222198.html
mont29 solution http://blenderclan.tuxfamily.org/html/modules/newbb/viewtopic.php?topic_id=31534&viewmode=flat&order=ASC&start=20
FunkyWirm solution http://blenderartists.org/forum/archive/index.php/t-203968.html