import os
import sys
import string
# fun2
def get_all_pod_spec():
path = os.path.expanduser('~/lazada_prj/Lazada4iPhone/Pods/')
return os.listdir(path)
# fun2
def getpods():
podspecs = get_all_pod_spec()
print (len(podspecs))
path = os.path.expanduser('~/lazada_prj/Lazada4iPhone/Pods/')
for specin podspecs:
subFrameworkPath = os.path.join(path, spec)
if os.path.isfile(subFrameworkPath):
print spec
continue
subFile = os.listdir(subFrameworkPath)
for childFWin subFile:
if string.find(childFW,'.framework') != -1:
gfilePath = os.path.join(subFrameworkPath,childFW)
gfiles = os.listdir(gfilePath)
for gfilein gfiles:
gfilename = childFW.replace('.framework','')
if gfile==gfilename:
nmpath = os.path.join(gfilePath,gfile)
syscommnd ='nm -U '+nmpath
output = os.popen(syscommnd, 'r')
frameworkC = output.read()
if readstdcxxOnly(frameworkC,childFW) =='find':
continue
def readstdcxxOnly(frameworkContent,framename):
path = os.path.expanduser('~/libstcxx/libstdcxx.txt')
fopen =open(path,'r')
stdcxxContentLines = fopen.readlines()
counti=1
for templinein stdcxxContentLines:
contentLine = templine.replace(' ','')
contentLine = contentLine.replace('\n', '')
contentLine = contentLine.replace(',', '')
contentLine = contentLine.replace('[', '')
contentLine = contentLine.replace(']', '')
contentLine = contentLine.replace('"', '')
counti = counti+1
if len(contentLine)<3:
continue
if string.find(frameworkContent,contentLine) != -1:
print framename+'---include libstdcxx---:'+contentLine
return 'find'
print 'notFount--'+framename
return 'NotFind'
# fun2
def main(argv):
getpods()
# fun2
if __name__ =='__main__':
main(sys.argv)
网友评论