import os import sys from coretools import * if sys.argv[1]=="create": path=sys.argv[2] pdata=open_project(path) print("Creating:"+os.path.dirname(path)+"/Makefile") create_makefile(pdata,os.path.dirname(path)+"/Makefile") if sys.argv[1]=="generate-gtk-app": f=open(sys.argv[2],'w') f.write("[Config]\n") f.write("app_name=Unnamed\n") f.write("libs=gtkmm-3.0\n") f.write("[Files]\n") f.write("files=main.cpp") f.close() if sys.argv[1]=="list-libs": ldata=scan_pkgconfig() v=(len(sys.argv)>2 and sys.argv[2]=="-v") for l in ldata: name,version,description=l if v: print ("* "+name+" :"+description) else: print ("* "+name) if sys.argv[1]=="check-libs": pdata=open_project(sys.argv[2]) ldata=scan_pkgconfig() if "libs" in pdata: libs=pdata["libs"].split(";") for l in libs: found=False for pkg in ldata: pname,pversion,pdesc=pkg if pname==l: found=True break print ("* "+l+":"+str(found))