scripts/python/ispublic/ispublic.py
author Sebastian Brannstrom <sebastianb@symbian.org>
Thu, 26 Nov 2009 17:51:27 +0000
changeset 16 b31eb4818219
parent 12 d2f4d301e581
permissions -rw-r--r--
Improved the script to show tech domain and package owner

import sys

def strip_path(pathname):
	pathname = pathname.strip()
	while pathname.find('/') != -1:
		x=pathname.find('/')
		pathname = pathname[x+1:]

	while pathname.find('\\') != -1:
		x=pathname.find('\\')
		pathname = pathname[x+1:]		
	
	#print 'strip_path returning %s' % pathname
	return pathname


res_f = open('symbian_2_public_api_list.txt')

pubapis=[]

for line in res_f:
	pathname = line[0:len(line)-1]
	
	filename = strip_path(pathname).lower()
	pubapis.append(filename)
	

	
def is_public(shortname):
	fname=strip_path(shortname).lower()
	#print 'finding %s in public apis' % fname
	
	return fname in pubapis

if (is_public(sys.argv[1])):
	print 'Public'
else:
	print 'Platform'