Here is my solution, but I think it's not a good one. Can anybody suggest me new solution, I want to enumarize windows, and get the Title property to compare by just using core library of python , not wnck or pygtk ...
def linux_CountWindowsByTitle(title):
import commands
XWinInfoOutput = commands.getoutput("xwininfo -all -root")
resArray = XWinInfoOutput.split("\n")
resRange = len(resArray) - 1
res = 0
#Parse each line of output
for i in range(0, resRange):
index = resArray[i].find("\"") #Get index of Double quote
if (index < 0):
continue #This line does not have title we need
tmp = resArray[i].split("\": (")[0] #Remove tail
windowName = tmp.split("\"",1)[1] #Remove head
if (UTILITY.Compare(title, windowName)):
#LIBRARY.Report(windowName)
res += 1
return res