https://github.com/start-jsk/rtmros_common/blob/9c30250a5df5793dd9df0b161fc7642835755b67/hrpsys_ros_bridge/scripts/hrpsys_dashboard is the good example of writing python code that works on both rosmake and catkin.

the example you mentioned had some trouble on same situation (sorry I can't point out but it actually have problem)