Small refactoring of class_list.cpp generator script
Use python functions instead of UNIX commands